Semantic HTML5
๐ Covered in this chapter:
Semantic vs Non-semantic ยท <header> <nav> <main> <section> <article> <aside> <footer> ยท <details> & <summary> Accordion ยท SEO & Accessibility Benefits
Welcome to Phase 6 (Chapter 14): Semantic HTML5! Semantic HTML uses tags that clearly describe their meaning to both browsers and developers. In this chapter, we master semantic layout tags (
<header>, <nav>, <main>, <section>, <article>, <aside>, <footer>), accordions with <details>, and SEO/a11y advantages over generic <div> containers.
1Semantic Layout Architecture
HTML โ Semantic Page Layout
โถ Run in HTML Editor
<header>
<h1>Our Compiler Tech Blog</h1>
</header>
<nav aria-label="Primary Navigation">
<a href="/">Home</a> | <a href="/tutorials">Tutorials</a>
</nav>
<main>
<article>
<h2>HTML5 Semantic Guide</h2>
<p>Learn semantic layout best practices.</p>
</article>
<aside>
<h3>Related Lessons</h3>
<p>CSS Grid & Flexbox</p>
</aside>
</main>
<footer>
<p>© 2026 Our Compiler</p>
</footer>
โ Frequently Asked Questions (FAQ)
Q1: Difference between <article> and <section>?
An <article> represents a self-contained content piece that makes sense on its own (e.g. blog post, news story, comment). A <section> represents a thematic grouping of content inside a document.