4

I'm implementing html5 into a blog template and am I little confused as to how to label different 'sections' on the front page. It's a magazine theme, so all topics are related loosely. For the sake of argument, let's say it is a movie site and I have news sections, trailer sections, and interviews. Would it be appropriate on my index to this:

<section>
    <h1>Trailers</h1>
        <ul>
          <li><a href="article">article</a></li>
          <li><a href="article">article</a></li>
          <li><a href="article">article</a></li>
          <li><a href="article">article</a></li>
        </ul>
</section>
Jon Lachonis
  • 911
  • 1
  • 8
  • 18
  • 1
    Nice guide: http://stackoverflow.com/questions/4781077/html5-best-practices-section-header-aside-article-tags – kirelagin May 27 '13 at 23:50

2 Answers2

3

According to the section spec:

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.

Meaning that if you just want to perform some scripting on the content or apply a style you should use div instead. And if you think that the contents of the section should be syndicated then you better use article tag.

Here you can see some examples and guidelines: http://www.w3.org/TR/2011/WD-html5-20110525/sections.html#headings-and-sections

Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
ssedano
  • 8,322
  • 9
  • 60
  • 98
2

That does not appear to be its intended use; confer, especially the second Note:

The section element is not a generic container element. When an element is needed only 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.

In essence, section is intended as part of document structure.

muhmuhten
  • 3,313
  • 1
  • 20
  • 26