HTML and CSS Reference
In-Depth Information
For each CSS property, the actual value that determines how the element will render is given by
the value possibly assigned directly to the element or to its innermost parent element. At the root of
the CSS hierarchy there's the default value assigned by the browser. Let's consider the following HTML
snippet:
<html>
<body>
<header>
<div>
Hello, world!
</div>
<div>
This is me.
</div>
</header>
This is the body of the page.
</body>
</html>
The text is given a default combination of fonts and colors by the browser. You can override these
settings by styling the BODY element. If you do so, all settings propagate down the document tree
and apply to any text in the page. If you intend to modify the text in HEADER , or in just one of the
DIV elements within the header, you add new style commands only to that element. Any settings
that are not explicitly overridden retain the value assigned to them at a higher level of the hierarchy.
Figure 3-2 illustrates the cascading model of CSS in which settings applied at a given element
affect all the elements found in the subtree rooted in that element.
FIGURE 3-2 The “cascading” model.
Search WWH ::




Custom Search