W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2008

[whatwg] The div element

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 28 Feb 2008 19:20:33 -0600
Message-ID: <dd0fbad0802281720k3e19346bg5c9a66d6f614420e@mail.gmail.com>
On Thu, Feb 28, 2008 at 5:07 PM, <html at nczonline.net> wrote:

> I'm still not clear to me how <section/> is anything more than a <div/>.
> HTML4 said: "The DIV and SPAN elements, in conjunction with the id and class
> attributes, offer a generic mechanism for adding structure to documents" (
> http://www.w3.org/TR/html401/struct/global.html#edef-DIV). Isn't that the
> very thing that <section/> is trying to do? Provide structure? I don't see
> that it offers anything over and above what <div/>s do now, except for
> confusing developers as to which is more appropriate to use.
>
> -Nicholas

<section> adds structure to *content*.  <div> adds structure to the entire
document.

If you insist, <section> is the new <div> for content structure, just like
<nav> is the new <div> for navigation elements or <footer> is the new <div>
for footer elements.  If used semantically, <section>s will only appear in
the actual content of the page, not on the overall structure.

As for being confusing, the name should certainly help sort things out.  Am
I wrapping up a section of content?  <section> it is!  Am I wrapping a
header, footer, nav, aside?  Already done!  Anything else?  Use <div>.

I feel you're probably just ignoring the distinction between the content of
a page and the page as a whole.  The division is pretty clear in most
examples in the wild, and so the usage should be fairly clear as well.

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080228/dc697c6c/attachment.htm>
Received on Thursday, 28 February 2008 17:20:33 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:39 UTC