Article & Section
Structuring content semantically
Skills taught: html.article, html.section, html.div-vs-semantic
Three elements handle content grouping in HTML — each with different intent:
- **article** — self-contained, independently shareable content
- **section** — thematic grouping within a document (always add a heading)
- **div** — a generic box with no semantic meaning (use as last resort)
<main>
<section aria-labelledby="latest-heading">
<h2 id="latest-heading">Latest Articles</h2>
<article>
<h3>Introduction to HTML</h3>
<p>Published by Prashant · 5 min read</p>
<p>HTML is the backbone of every web page...</p>
<a href="/html-intro">Read more</a>
</article>
<article>
<h3>CSS Flexbox Guide</h3>
<p>Published by Prashant · 8 min read</p>
<p>Flexbox makes layout simple...</p>
<a href="/flexbox">Read more</a>
</article>
</section>
</main>
Tip:
<article>
<h2>A Complete Guide to HTML Forms</h2>
<p>Forms are the backbone of interactive web apps.</p>
<section>
<h3>Form Basics</h3>
<p>The form element wraps all controls...</p>
</section>
<section>
<h3>Validation</h3>
<p>HTML5 adds built-in validation attributes...</p>
</section>
</article>
Warning:
Frequently Asked Questions
Can I put article inside article?
Yes. A comments section inside a blog post is a common example — the post is an article, and each comment is a nested article.
What is the difference between section and div?
section has semantic meaning — it groups related content thematically and should have a heading. div is a generic container with no semantic meaning, used purely for layout and styling.
Does Google understand article and section?
Yes. Google's crawlers parse semantic HTML. article helps identify primary content for Featured Snippets. section helps understand page structure for breadcrumb rich results.