HTML and CSS Reference
In-Depth Information
Figure 3-10. The ID selectors override the previous three.
Our fifth pair demonstrates the power of inline styles. By adding style="color:#ccc;"
directly to the opening <h1> and <p> tags , we override all the styles set in the style sheet (the
style sheet does not change from the previous example, only the markup). Inline styles are
given more importance by the browsers than any of the selectors in the style sheet, and there-
fore override even the ID selector.
Markup
<h1>Page Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.</p>
<div>
<h1>Page Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="module">
<h1>Page Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div id="content" class="module">
<h1>Page Title</h1>
Search WWH ::




Custom Search