Skip to content

HTML Accessibility Guide

Accessible HTML ensures your website works for everyone, including people using screen readers, keyboards, or other assistive technologies.

  • 1 billion+ people worldwide have disabilities
  • Accessible sites rank better in search engines
  • Many accessibility features benefit all users
  • Legal requirements in many countries (ADA, WCAG)

Semantic elements convey meaning to assistive technologies.

<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
<main>
<article>
<h1>Article Title</h1>
<p>Content...</p>
</article>
</main>

All images need alt text:

Result

Use headings (<h1> through <h6>) in logical order:

<h1>Main Page Title</h1>
<h2>Section 1</h2>
<h3>Subsection 1.1</h3>
<h3>Subsection 1.2</h3>
<h2>Section 2</h2>

Always associate labels with inputs:

Result

All interactive elements must be keyboard accessible:

  • Use <button> for actions, <a> for navigation
  • Don’t remove focus outlines (style them instead)
  • Use logical tab order (or tabindex="0")
  • Provide skip links for repetitive content
<!-- Skip link at top of page -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<!-- Main content target -->
<main id="main-content">
...
</main>

ARIA (Accessible Rich Internet Applications) supplements HTML when native semantics aren’t enough.

<!-- Live regions for dynamic content -->
<div aria-live="polite">
<!-- Content updates announced to screen readers -->
</div>
<!-- Expanded/collapsed state -->
<button aria-expanded="false" aria-controls="menu">
Menu
</button>
<div id="menu" hidden>...</div>
<!-- Custom controls -->
<div role="slider"
aria-valuemin="0"
aria-valuemax="100"
aria-valuenow="50"
aria-label="Volume">
</div>
  1. Keyboard test: Navigate your entire site using only Tab, Enter, and arrow keys
  2. Screen reader test: Use VoiceOver (Mac), NVDA (Windows), or Orca (Linux)
  3. Automated tools: axe, WAVE, Lighthouse accessibility audit
  4. Color contrast: Ensure 4.5:1 ratio for normal text, 3:1 for large text
  • All images have appropriate alt text
  • Headings are in logical order (no skipped levels)
  • All form inputs have associated labels
  • Color is not the only way to convey information
  • Focus indicators are visible
  • Skip links are provided for navigation
  • ARIA is used correctly (or not at all if unnecessary)
  • Page works with 200% zoom
  • Videos have captions