Continued from page 1
change
element individually, each time it appeared) .Style sheets let Web designers quickly create more consistent pages--and more consistent sites. How Style sheets are Implemented
There are 3 basic ways to add
functionality of Style Sheets:
1. Inline - Creating
elements for each HTML Tag. This will allow
same HTML Tag to have different styles on
same page.
2. Embedding - Creating
elements on
page itself that will affect every occurrence of an HTML Tag.
3. Linking - Creating one page that defines
elements and include in
pages that you want to affect.
For beginners using Embedding or Linking is recommended.. The Linking Style is used when you want to use
same style on multiple pages, you can then use Embedding and/or Inline on specific pages that don't fit
design style of
Linking Sheet.
Precedence and inheritance
As
term Cascading Style Sheets implies, more than one style sheet can be used on
same document, with different levels of importance. Generally styles from different style sheets merge together (cascade) into a virtual style.
However, If you define conflicting styles for
same HTML element,
innermost definition--the one closest to
individual tag-wins
The precedence Style Sheets follow is Inline, Embedding, then Linking. Inline Style takes precedence over Embedding Style, which takes precedence over Linking Style.
There is a fourth style sheet which is set not by
document author but by
reader and that is
browser default. Taking this style sheet into consideration
order of precedence is:
1. Inline Style (inside HTML element) .
2. Embedding Style Sheet (inside
tag).
3. External Style Sheet.
4. Browser default.
So, an inline style (inside an HTML element) has
highest priority, which means that it will override every style declared inside
tag, in an external style sheet, and in a browser (a default value).
![](images/ata.gif)
Stephen Cope is a freelance trainer and the Webmaster at - making a website and Niche Website Guide.