Download & Extend

Convert section#main, section#content to div#main

Project:HTML5 Base
Version:6.x-1.0-beta1
Component:HTML5 spec interpretation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

The spec http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.htm... defines a section as "generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading"

The section#main and section#content is unnecessary as it does not represent any meaningful outline and also does not have a heading (the section#content-area will).

I think we should not rush to convert every div to a section without just cause.

Comments

#1

I only half-agree. I think having #main as a SECTION is unnecessary, but I think that #content should definitely stay as a SECTION.

Then again, it's a draft spec anyway, and there aren't penalties for interpreting it wrong (...yet?), so I wouldn't worry too much about going back and forth on this. We've done that with ASIDEs for the sidebars, and we'll probably all be wrong by the time the draft is finalized.

#2

I don't think the spec is going to differ any more on major HTML5 elements. It is a known devil with almost all major browsers implementing html5 parsing based on that.

Also, #content should remain a section only if it contains a heading (as a typical use). I notice there is a conditional for when a heading exists, but I think it will complicate matters if #content alters in which element it uses in the markup based on that conditional. I think for a theme that aims to be a base, it should err on the side of what is simple and definitely valid for all conditions than not.

#3

I also agree that #main as a section is not needed. And although section#content may not be 100% valid, it only makes sense to leave it as a section as it's where, in most cases, the majority of your content will live. Also note it says typically includes a header. So while it may not be 100% valid, it's certainly not invalid either, and makes much more sense.

I also can't see changing the html element based on the presence of a title being a good alternative.

#4

Hello everyone. Chiming in a bit late, but I agree with nimbupani.

I feel the he section should be a div, as Bruce Lawson writes on his site:

What we’ve been doing wrong is using section to wrap content in order to style it, or to demarcate the main content area from the nav, header, footer etc. These are jobs for div, not section.

Bruce is explaining that HTML5 Doctor site was doing the same thing (section vs. div for main content)- and has determined that to be incorrect. And, I agree. From a purely semantic standpoint, section seems like it would be correct. But, at this point in the spec, it is not correct.

It is difficult to decipher when it is correct or not to use a section, but mantra has been- when in doubt, use a div.

#5

Just a note that this issue is effectively a dupe of http://drupal.org/node/1052616 the only difference being that the other is marked for 7.x
There's a patch for 7.x http://drupal.org/node/1052616#comment-4214426 that I suspect would apply to 6.x too…