I am reading over HTML5 docs on W3C site now, and I just read this:
Note: The section element is not a
generic container element. When an
element is needed for styling purposes
or as a convenience for scripting,
authors are encouraged to use the div
element instead. A general rule is
that the section element is
appropriate only if the element’s
contents would be listed explicitly in
the document’s outline.
So, I interpret that as “Do not style section elements. Use DIV instead.” But I’ve seen a few websites that style all of the HTML5 elements, and guess what? I ‘Viewed Source’ of that W3C link below where it says not to style a section element, and they styled it themselves! WTF?
http://www.w3.org/TR/html5/sections.html#the-section-element
Or should I interpret the above statement as:
“You can style section elements, so long as the contents of the section element would be listed explicitely in the document’s outline.”?
The HTML5 spec does not state that you shouldn’t apply CSS styles to the
sectiontag, but rather that you shouldn’t includesectiontags simply for styling/scripting purposes, as that affects the semantic layout of your document.From the section about
section:Compare to the section about
div: