On this page
Semantic Document Structure
Prev: tutorials | Up: tutorials | Next: Accessible Forms & Validation
Rel: Document & Landmarks, Text & Lists, Progressive Enhancement & Accessibility
Ref: MDN Web Docs — Structuring Documents
Tags: #public #web #html #tutorials
Contents
Building a Clean Landmark Outline
Screen reader users navigate pages by jumping between landmarks and headings. Combine semantic landmarks with a single visible <main> and distinct aria-label values whenever a landmark type (like <nav>) appears more than once.
<body>
<a class="skip-link" href="#main-content">Skip to main content</a>
<header>
<nav aria-label="Main navigation">
<ul>
<li><a href="index.html" aria-current="page">Home</a></li>
<li><a href="docs.html">Docs</a></li>
</ul>
</nav>
</header>
<main id="main-content">
<h1>Semantic HTML</h1>
<section aria-labelledby="why-heading">
<h2 id="why-heading">Why Landmarks Matter</h2>
<p>Landmarks provide built-in navigation structure with zero JavaScript.</p>
</section>
</main>
<footer>
<nav aria-label="Footer navigation">
<a href="privacy.html">Privacy</a>
</nav>
</footer>
</body>
Skip Links & Heading Discipline
- Include a skip link targeting
#main-contentso keyboard users can bypass repeated header links. - Use
aria-current="page"on the active navigation link (targetable in CSS viaa[aria-current="page"]). - Treat
<h1>–<h6>as a document outline, never as font-size shortcuts.
Linked from
Related notes
- tuts/html/tutorials Linked here; links to this page; shared tags: #html, #tutorials, #web
- tuts/html/tutorials/accessible_forms_and_validation Linked here; links to this page; shared tags: #html, #tutorials, #web
- tuts/html/elements/document_and_landmarks Linked here; links to this page; shared tags: #html, #web
- tuts/html/elements/text_and_lists Linked here; links to this page; shared tags: #html, #web
- tuts/web/tutorials/progressive_enhancement_and_accessibility Linked here; links to this page; shared tags: #tutorials, #web
- tuts/html/tutorials/media_and_responsive_images shared tags: #html, #tutorials, #web
- tuts/html/tutorials/native_interactive_patterns shared tags: #html, #tutorials, #web
- tuts/css/tutorials shared tags: #tutorials, #web
- tuts/css/tutorials/box_model_and_formatting_contexts shared tags: #tutorials, #web
- tuts/css/tutorials/cascade_specificity_and_inheritance shared tags: #tutorials, #web