Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In HTML5 should I use article or section tags to make tabs?

Tags:

html

css

I want to create a set of content tabs for a design I'm building in HTML5. I'm wondering if I should use a set of <article> or <section> tags to contain the content?

like image 720
Soviut Avatar asked Feb 25 '11 17:02

Soviut


1 Answers

<section> seems ideal to me. Its definition applies quite neatly to something like content tabs:

The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.

Examples of sections would be chapters, 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, and contact information.

Take note of what it says about <article> on that same page though:

Authors are encouraged to use the article element instead of the section element when it would make sense to syndicate the contents of the element.

So if the content of your tabs is self-contained and makes sense when read in isolation (and could be used that way), use <article>, if it doesn't use <section>.

like image 138
Will Prescott Avatar answered Oct 05 '22 05:10

Will Prescott