HTML and CSS Reference
In-Depth Information
note
Specificity is covered in detail in Chapter 3.
The order of appearance , or source order, of the declaration is deter-
mined by the order the rules are encountered in the set of documents in
a given source category where the later declaration replaces all earlier
declarations.
To calculate the winning declaration for a given property, first weight is
considered. If multiple declarations share the highest weight source, then
specificity is considered. Finally, if multiple declarations share the same,
greatest specificity, then order of appearance is used to pick the appropri-
ate declaration to apply.
Figure 1.2 shows the cascade of rules for a link in the footer of the
Apple.com home page as viewed in the Safari Web Inspector. Declarations
that appear crossed out have been trumped by other declarations of that
property higher in the cascading order.
Figure 1.2
The Safari
Web Inspector
displaying the
cascade.
 
Search WWH ::




Custom Search