S_A
S_A

Reputation: 423

HTML 5 best practice - When and where should I use section or article?

There's a couple information about HTML 5, but I'm really confused about the best practices to use on my website especifically when and where I should use section or article. So what do you guys think of the following layout divisions?

enter image description here

ps: The blue boxes are just some call to action like "buy now" or something like that.

Upvotes: 0

Views: 111

Answers (1)

James Taylor
James Taylor

Reputation: 6268

This question is currently being flagged for being primarily opinion based, perhaps for good reason.

The best answer that could possibly be given to this question is to look at the HTML5 spec, which states:

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

When article elements are nested, the inner article elements represent articles that are in principle related to the contents of the outer article. For instance, a blog entry on a site that accepts user-submitted comments could represent the comments as article elements nested within the article element for the blog entry.

So putting this into context with your question, I think you should be using section tags rather than article. Again, these are both block-level elements which should be functionally the same, making this answer subjective.

Upvotes: 1

Related Questions