Web Design

(Nancy Kaufman) #1

149


CHAPTER

Advanced CSS 5


TIP


What factors determine which rules apply?
The most important factor in determining whether a style overrides another is specificity. That is, a
declaration with a more specific selector overrides one with a less specific selector. ID selectors, for
example, are very specific: They target one distinct element on a page. Class selectors are less specific,
and element selectors less still. The relative proximity of a style declaration to its affected element is
another factor in determining whether a particular rule is overridden.

● When the page is viewed in
a browser, the embedded
style sheet’s rule overrides
conflicting rules on the
linked style sheet.

3 Add one or more declarations
to the embedded style sheet.


4 Type .


4


3

Free download pdf