<br><br><div class="gmail_quote">On Wed, Feb 27, 2008 at 7:38 PM, Geoff Pack <<a href="mailto:pack.geoff@abc.net.au">pack.geoff@abc.net.au</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Why does the HTML5 spec say "The div element represents nothing at all" ?<br>
[<a href="http://www.whatwg.org/specs/web-apps/current-work/#the-div" target="_blank">http://www.whatwg.org/specs/web-apps/current-work/#the-div</a>]<br>
<br>
Div clearly stands for 'division', as was specified in the HTML 3.2 spec:<br>
"DIV elements can be used to structure HTML documents as a hierarchy of<br>
divisions." [<a href="http://www.w3.org/TR/REC-html32#div" target="_blank">http://www.w3.org/TR/REC-html32#div</a>]<br>
<br>
So what gives - why is everyone so keen to claim that 'div' is meaningless?<br>
And why so keen on 'section', which is pretty much synonymous in this<br>
context.<br>
<br>
Cheers,<br>
</blockquote></div>That definition you quote gives the answer. ^_^ "A division" doesn't tell you *anything* about what the content of the <div> means, or what place it holds within the greater structure of the document. It's merely a 'division'. The lack of any further definition has led to its use for *anything* that needs grouping, leading to the term "div-mania". I used <div>s all over the place when I first started coding, before I learned proper practices (luckily, the only applications were internal and aren't used anymore, so I didn't contribute to the poor state of the web ^_^). Even if you can divine some actual semantics out of the 3.2 definition, <div> has clearly lost all semantics in practice, which is what matters.<br>
<br><section> doesn't have quite that problem. It's a generic grouping element, true, but it is so in the same way that <p> is. It's designed to wrap *content* that's thematically related, and the examples give relatively clear usage guidelines. It may lose its semantics in practice, but we'll have to wait to see that. I'm hopeful, for several reasons. One, <div> already exists, and has spread to fill all niches naturally, leaving <section> little incentive to spread similarly. ^_^ As well, <section>'s name is more specific and gives its semantics more clearly. Finally, a lot of the common places where <div> is currently used (and <section> could be applied) are instead filled with new elements, restricting <section>'s ability to get a foothold in generic-ness.<br>
<br>Anyway, we need a meaningless block-level element, the same as we need <span> for in-line content. It lets us fill in the holes that the spec fails to or refuses to cover, without muddying up the document's semantics.<br>
<br>~TJ Atkins<br>