Prev | Current Page 81 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"

They are de?¬? ned in the default browser style sheet, and
the browser updates any that are also de?¬? ned in the other locations.
If, for example, the author style sheet style de?¬? nes the


tag??™s font-family to be Helvetica but the

tag is also speci?¬? ed to
be Verdana in an embedded (page) style, the paragraph will be displayed
in Verdana??”the embedded styles are read after the author
style sheet. However, if there is no style for paragraphs in the user or
author style sheet, they will display in Times, because that??™s the style
de?¬? ned in all browser default style sheets.
That??™s the basic idea of how the Cascade works, but in fact, there are
several rules that control the Cascade.
The Cascade Rules
In addition to the order in which styles are applied, you should
know several rules about how the Cascade works.
Cascade Rule 1: Find all declarations that apply to each element
and property. As it loads each page, the browser looks at every tag
in the page to see if a rule matches it.
The Cascade de?¬? nes the order in
which the styles available to a document
are read and updated.
Get more info on the Cascade at the
W3C site (www.w3.org/TR/CSS2/
cascade.html).
HOW CSS WORKS 57
Cascade Rule 2: Sort by order and weight. The browser sequentially
checks each of the ?¬? ve sources, setting any matched properties as
it goes.


Pages:
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93