The Cascade: When Rules Collide
There are many places to apply styles. As we saw back in Chapter 1, every browser has its own default styles (see page 42). Next, you can write style rules and apply them to a specific (X)HTML element right in the code, insert them at the top of an (X)HTML document, and import one or more from an external file (see page 127). And some browsers let your visitors create and apply their own style sheets to any pages they visit—including yours. Finally, some styles are inherited from parent element to child.
Figure 7.5. Here is the style sheet for this document. Don’t worry too much about the details right now, but do notice that there is a rule for p elements, but not for em elements.
What happens, you might ...
Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.