CSS – part 2

cascading_style_sheet_css.jpgEffectiveness of style sheetsThe display of HTML elements are defined by the Styles sheets e.g. of which would be the font tag and color attribute in HTML 3.2. External CSS files normally do the work of saving these files these external style sheets enable you to morph the layout and appearance of the pages by editing just one single CSS document.

This is a revolutionary step in web designing due to its allowance to developers to be able to keep a tab on the style and layout or a large number of web pages all at once. It enables an automatic upgradation of all the elements in the web by simply changing the style, thus enabling control of design and layout in a very simple and uncomplicated way making it one of the most effective and time saving tools that are available in web designing today.

Multiple Styles Cascading into one
The flexibility of style sheets allows style to be specified in a lot of ways, they can be specified in a single HTML element under the ‘head’ element of a particular external CSS file or HTML page. A single HTML document may also be reference multiple external style sheets.Cascading Order

What style will be used when there is more than one style specified for an HTML element?
mostly most of the styles will “cascade” into a fresh new “virtual” style sheet due to its following the understated rules in which inline style will be the most prominent:

  1. External style sheet
  2. browser default
  3. Inline style (inside an HTML element)
  4. Internal style sheet (inside the <head> tag)

So the number three has the highest priority, which also means that it will overcome a style nominated under a head tag declared in an external style sheet or a default value browser (user interface). So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value).

Comments are closed.