Semantic HTML uses elements that describe the meaning of content — <header>, <nav>, <main>, <footer> — instead of generic <div>s. This makes pages more accessible, SEO-friendly and maintainable.
The structural elements
| Element | Represents |
|---|---|
<header> | Introductory content / top of a page or section |
<nav> | Navigation links |
<main> | The main content (one per page) |
<article> | Self-contained content (a post, a card) |
<section> | A thematic grouping |
<aside> | Tangential content (a sidebar) |
<footer> | Footer of a page or section |
<body><header><nav>…</nav></header><main><article><h1>Post title</h1><section>…</section></article><aside>Related links</aside></main><footer>© 2026</footer></body>
Key takeaways
- 01Semantic elements describe meaning: header, nav, main, article, section, aside, footer.
- 02They improve accessibility (screen-reader landmarks) and SEO.
- 03Use <main> once per page for the primary content.
- 04Prefer semantic elements over generic <div>s; use <div> only when nothing fits.
