HTML and CSS Reference
In-Depth Information
In fact, it doesn't matter what level of heading you use here;
the outlining algorithm cares about nesting and relative levels,
so this code
<h3>Hello</h3>
<article>
<h6>World</h6>
</article>
produces exactly the same result as Figure 2.6.
Yo u m i g h t b e s a y i n g , “ S o w h a t . W h a t ' s t h e u s e f o r t h a t ? ” W e l l ,
fi r s it fi y , fi it m e a n s y of u ' r e n of it r e s it r fi c it e d it of s fi x fi e v e fi s of fi h e a d fi n g s , a s
you are in HTML 4. A heading element nested inside seven lev-
els of <section> , <article> , <nav> , or <aside> (or any combina-
tion of them) becomes a logical <h7> element (however, unless
you're marking up legal documents or some other horrors, you
should reconsider your content if you need so many levels).
Another advantage is with syndication. Suppose Remy posts
an article:
<article>
<h1>What I did on my holiday</h1>
<p>I went to Narnia. I was bitten by a trilobite. Then I
¬ came home.</p>
</article>
Let's say you run a large online newspaper and naturally wish to
syndicate this story. When the magic syndication machines slot
it into your template, the resulting code is
<h1>The Monotonous Times</h1>
<section>
<h2>Breaking news</h2>
<article>
<h1>What I did on my holiday</h1>
<p>I went to Narnia. I was bitten by a trilobite.
¬ Then I came home.</p>
</article>
..
</section>
It's obvious that “breaking news” is higher in the hierarchy of
headings than the title of Remy's blog post, but due to a mis-
match between Remy's template and your template, there's an
<h2> that is more important than the <h1> .
 
Search WWH ::




Custom Search