HTML
Module 9: Semantic HTML and Page Layouts
section, article, and aside
Choose between thematic sections, self-contained compositions, and complementary content.
7 minute lessonBeginner to advanced
The section, article, and aside elements are often confused because all three can contain headings and paragraphs. Their purpose is different.
articlerepresents a self-contained composition that could make sense independently, such as a news story, forum post, or product review.sectiongroups content by a common theme, usually with a heading.asidecontains content that is related but not central to the main flow, such as a sidebar note or related links.
<main>
<article>
<h1>How browser caching works</h1>
<p>...</p>
<section>
<h2>Freshness and revalidation</h2>
<p>...</p>
</section>
</article>
<aside>
<h2>Related reading</h2>
<a href="/guides/http/">HTTP basics</a>
</aside>
</main>
A section should have a reason to exist beyond styling. If you only need a wrapper for CSS or scripting and the content has no distinct theme, a div may be the better choice. An article can contain sections when the relationships make sense.