Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other HTML5 Section tag Re: HTML5 Section tag

#103606
Paulie_D
Member

A ‘section’ element should not be used as a general substitute for a div however. The idea is that a section is a piece (or even a whole group of similar pieces) of content that are “different” from the content next to or around them.

If you have two elements containing ‘news’ then then you should use divs. If you have content for ‘news’ and another for ‘reviews’ then a ‘section’ would be appropriate. That’s not to say that you can’t put divs inside the sections if you want.

A section element by itself does nothing but it does make it an easy way to tell one …ahem…section of your content from another IF you view the code, otherwise you might as well use a div.

HTML5 Doctor, having being referenced says

“Represents a generic document or application section. In this context, a section is a thematic grouping of content, typically with a header, possibly with a footer. Examples include chapters in a book, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A web site’s home page could be split into sections for an introduction, news items, contact information.”

and

“With very few exceptions, section should not be used if there is no natural heading for it. “