Semantics and accessibility
Semantic layout elements
Goal: Structure a page with header, nav, main, article, section, aside and footer · 9 min
Generic <div> boxes say nothing about their content. Semantic elements do:
| element | meaning |
|---|---|
| header | introductory content, logo, site title |
| nav | major navigation links |
| main | the main content — once per page |
| article | self-contained piece (blog post, product card) |
| section | thematic group, normally with a heading |
| aside | side content (related links, info box) |
| footer | closing info: copyright, contact, imprint |
Screen readers offer shortcuts to these landmarks, and search engines use them to identify the main content. Use <div> only when no semantic element fits (e.g. purely for styling).
Worked example: Page skeleton
- header with nav at the top.
- main with one article.
- footer at the end.
<header>
<a href="/">Lumen</a>
<nav><a href="/blog">Blog</a></nav>
</header>
<main>
<article>
<h1>Hello world</h1>
<p>First post.</p>
</article>
</main>
<footer><p>© 2025 Lumen</p></footer>