Three grouping elements are easy to confuse. The rule of thumb: <article> for standalone content, <section> for a thematic part of something, and <div> only when neither fits.
The distinction
| Element | Use when… |
|---|---|
<article> | The content is self-contained and could stand alone (a blog post, a product card, a comment) |
<section> | It's a thematic grouping within a page, usually with a heading |
<div> | You just need a styling/scripting wrapper with no semantic meaning |
Key takeaways
- 01<article>: self-contained content that could stand alone (post, card, comment).
- 02<section>: a thematic part of a page, usually with a heading.
- 03<div>: a meaningless wrapper for styling/scripting only.
- 04Test for article: would it make sense syndicated on its own?
