Lesson 4 of 9
Article, Section & Content Grouping
The <article> and <section> elements are often confused. <article> represents self-contained content that makes sense independently (blog post, product card, comment). <section> represents a thematic grouping that needs context. Understanding the difference is critical for proper semantic HTML and SEO.
Article vs Section
The key test: Would the content make sense if extracted and placed on its own page or in an RSS feed?
<article> - Self-contained, independent:
• Blog post
• Product card
• User comment
• Tweet or social media post
• News story
<section> - Thematic grouping, requires context:
• A chapter in a book
• Tab panels in an interface
• 'About Us' or 'Contact' section on a homepage
Nesting rules:
• <article> can contain <section>s (sections of the article: intro, details, conclusion)
• <section> can contain <article>s (a 'Latest Posts' section containing article cards)
• Both SHOULD have a heading (h2-h6)
Common mistake: Using <section> as a styling wrapper. If an element exists only for CSS styling, use <div> instead.
Use article for self-contained syndicatable content; section for thematic grouping
Tip
Apply the 'RSS test' - if you can put the content into an RSS feed and it still makes complete sense on its own, use <article>. If the content only makes sense within the context of the page, use <section>. A product review is an <article>; the 'Related Products' area is a <section>.
Quick Quiz: Content Grouping
Finished this lesson?