Client-side development
Main elements of client-side application components of distributed systems
Distributed systems use client-side elements for users to interact with them. The main client-side elements are,
•Views –what users see (mainly GUIs)
•Controllers –contain event handers for the Views
•Client-model –Business logic and data
Views development technologies for the browser-based client-components
Mainly use two elements for view development technology.- HTML-Content
- CSS - Formatting
HTML uses different types of elements to define content
•Structural elements
•header, footer, nav, aside, article
•Text elements
•Headings –<h1> to <h6>
•Paragraph –<p>
•Line break -<br>
•Images
•Hyperlinks
•Data representational elements (these elements use nested structures)
•Lists
•Tables
•Form elements
•Input
•Radio buttons, check boxes
•Buttons
CSS
CSS is used to decorate/ Format content
Here are few advantages of CSS,
•Reduce HTML formatting tags
•Easy modification
•Save lot of work and time
•Faster loading
There are 3 main selectors
•Element selector
Also referred to simply as a “type selector,” this selector must match one or more HTML elements of the same name. Thus, a selector of nav would match all HTML
nav
elements, and a selector of <ul>
would match all HTML unordered lists, or <ul>
elements.
The following example uses an element type selector to match all
<ul>
elements
To put this in some context, here’s a section of HTML to which we’ll apply the above CSS:
There are three main elements making up this part of the page: Two
<ul>
elements and a <div>
. The CSS will apply only to the two <ul>
elements, and not to the <div>
. Were we to change the element type selector to use <div>
instead of <ul>
, then the styles would apply to the <div>
and not to the two <ul>
elements.
Also note that the styles will not apply to the elements inside the
•ID selector<ul>
or <div>
elements. That being said, some of the styles may be inherited by those inner elements.
An ID selector is declared using a hash, or pound symbol (
#
) preceding a string of characters. The string of characters is defined by the developer. This selector matches any HTML element that has an ID attribute with the same value as that of the selector, but minus the hash symbol.
Here’s an example:
This CSS uses an ID selector to match an HTML element such as:
<div id="container"></div>
In this case, the fact that this is a
<div>
element doesn’t matter—it could be any kind of HTML element. As long as it has an ID attribute with a value of container
, the styles will apply.
An ID element on a web page should be unique. That is, there should only be a single element on any given page with an ID of
If there happens to be more than one element on the page with the same ID, the styles will still apply, but the HTML on such a page would be invalid from a technical standpoint, so you’ll want to avoid doing this.In addition to the problems of inflexibility, ID selectors also have the problem of very high specificity.container
. This makes the ID selector quite inflexible, because the styles used in the ID selector rule set can be used only once per page.•Class selector
The class selector is the most useful of all CSS selectors. It’s declared with a dot preceding a string of one or more characters. Just as is the case with an ID selector, this string of characters is defined by the developer. The class selector also matches all elements on the page that have their class attribute set to the same value as the class, minus the dot.
Take the following rule set:
These styles will apply to the following HTML element:
<div class="box"></div>
The same styles will also apply to any other HTML elements that have a class attribute with a value of
box
. Having multiple elements on a single page with the same class attribute is beneficial, because it allows you to reuse styles, and avoid needless repetition. In addition to this, class selectors have very low specificity—again, more on this later.
Another reason the class selector is a valuable ally is that HTML allows multiple classes to be added to a single element. This is done by separating the classes in the HTML class attribute using spaces. Here’s an example:
<div class=”box box-more box-extended”></div>
https://www.sitepoint.com/css-selectors/Advanced CSS selectors
Before delving into the realms of advanced CSS selectors, it’s important to understand how CSS specificity works, so that we know how to properly use our selectors and to avoid us spending hours debugging for a CSS issue that could be easily fixed if we had only payed attention to the specificity.When we are writing our CSS we have to keep in mind that some selectors will rank higher than others in the cascade, the latest selector that we wrote will not always override the previous ones that we wrote for the same elements.
1. Attribute Selectors
Attribute selectors let you target an element based on its attributes. You can specify the element’s attribute only, so all the elements that have that attribute — whatever the value — within the HTML will be targeted, or be more specific and target elements that have particular values on their attributes — and this is where attribute selectors show their power.
2. Child Selector
The child selector is represented by the sign “>”. It allows you to target elements that are direct children of a particular element.
3. Sibling Combinators
4. Pseudo-Classes
Different type of CSS used
There are 3 type of CSS using.
01) Inline CSS: Inline CSS contains the CSS property in the body section attached with element is known as inline CSS. This kind of style is specified within an HTML tag using style attribute.
EG:
Other view development tools
•jQuery–A JS library, but can be seen a framework too. It wraps the complexity of pure JS. There are lots of JS frameworks, libraries, and plugins built using jQuery. Good for DOM processing.
•jQuery UI –Focus on GUI development
•Bootstrap–to rapidly design and develop responsive web pages and templates
•Angular–a JS framework/platform to build frontend applications
•React–a JavaScript library for building user interfaces (and the application, which uses that UI)
Finlally let's tal about the new featurs in JS version 6
- Setting defaults for function parameters
- Extracting Data from Arrays and Objects with Destructuring
- Checking Array Values with Array#includes()
- Allowing Extra Arguments in Functions
- Expanding Arrays with the Spread Operator
- Naming of anonymous functions
Comments
Post a Comment