Overview
Accessibility rules ensure your website is usable by everyone, including people with disabilities. Accessible sites also perform better in search results and provide better user experiences overall.Why accessibility matters: 15% of the world’s population has some form of disability. Making your site accessible expands your audience and is often legally required.
Image Alt Text
Rule: a11y/image-alt
What it checks:
- All images have
altattributes - Alt text is descriptive (not empty or generic)
- Decorative images use empty alt (
alt="") - Complex images have detailed descriptions
Writing Good Alt Text
Writing Good Alt Text
- Be specific and concise (typically 125 characters or less)
- Describe the content and function, not just appearance
- Don’t say “image of” or “picture of” (screen readers announce it’s an image)
- For decorative images, use
alt=""(empty, not missing) - For functional images (buttons, links), describe the action
- For charts/graphs, summarize the key insight
ARIA Landmarks
Rule: a11y/landmarks
What it checks:
- Page has semantic HTML5 landmarks
- Proper use of
<header>,<nav>,<main>,<aside>,<footer> - ARIA roles used correctly
- One
<main>landmark per page
Fix Missing Landmarks
Fix Missing Landmarks
Issue: No ARIA landmark roles:
<main> landmark| HTML5 Element | ARIA Role | Purpose |
|---|---|---|
<header> | banner | Site header |
<nav> | navigation | Navigation menu |
<main> | main | Primary content |
<aside> | complementary | Related content |
<footer> | contentinfo | Site footer |
<section> | region | Thematic content |
<article> | article | Self-contained content |
<form> | form | Form |
<search> | search | Search widget |
Use HTML5 semantic elements (
<main>, <nav>, etc.) instead of ARIA roles when possible. HTML5 elements have better browser support.Skip Links
Rule: a11y/skip-link
What it checks:
- “Skip to main content” link exists
- Link is first focusable element
- Link works correctly
Add Skip Link
Add Skip Link
Color Contrast
Rule: a11y/color-contrast
What it checks:
- Text meets WCAG AA contrast ratio (4.5:1 for normal text, 3:1 for large text)
- Links are distinguishable from surrounding text
- UI components have sufficient contrast
Fix Contrast Issues
Fix Contrast Issues
WCAG Contrast Requirements:
Testing tools:
| Level | Normal Text | Large Text (18pt+) |
|---|---|---|
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
- WebAIM Contrast Checker
- Chrome DevTools (Inspect element → Color picker shows contrast ratio)
- Contrast Finder (suggests fixes)
Keyboard Navigation
Rule: a11y/keyboard
What it checks:
- All interactive elements are keyboard accessible
- Focus order is logical
- Focus indicators are visible
- No keyboard traps
Ensure Keyboard Accessibility
Ensure Keyboard Accessibility
Keyboard navigation requirements:Focus styles (never remove!):Logical tab order:
Form Labels
Rule: a11y/form-labels
What it checks:
- All form inputs have associated labels
- Labels are properly linked to inputs
- Required fields are indicated
- Error messages are accessible
Accessible Forms
Accessible Forms
- Always use
<label>elements (not placeholders alone) - Use
aria-required="true"on required fields - Use
aria-invalid="true"for fields with errors - Link error messages with
aria-describedby - Group related inputs with
<fieldset>and<legend>
Heading Hierarchy
Rule: a11y/heading-order
What it checks:
- Headings follow logical order (H1 → H2 → H3)
- No skipped heading levels (H1 → H3)
- One H1 per page
- Headings describe content accurately
Fix Heading Hierarchy
Fix Heading Hierarchy
ARIA Attributes
Common ARIA Attributes
aria-label
aria-label
Provides accessible name when visible text isn’t sufficient:
aria-labelledby & aria-describedby
aria-labelledby & aria-describedby
References other elements for labels/descriptions:
aria-hidden
aria-hidden
aria-live
aria-live
Announces dynamic content changes:aria-live values:
off: Don’t announce (default)polite: Announce when user is idleassertive: Announce immediately (use sparingly)
Testing Accessibility
WAVE
Browser extension for visual accessibility evaluation
axe DevTools
Automated accessibility testing in browser DevTools
Lighthouse
Accessibility audit built into Chrome DevTools
NVDA Screen Reader
Free screen reader for Windows (test with real tools)
WCAG Compliance Levels
| Level | Requirements | Use Case |
|---|---|---|
| A | Minimum | Bare minimum (not recommended as target) |
| AA | Standard | Target for most sites (legally required in many jurisdictions) |
| AAA | Enhanced | Maximum accessibility (difficult to achieve for all content) |
WCAG 2.1 Level AA is the standard target and is legally required in many countries (EU, US Section 508, ADA).
Accessibility Checklist
Images & Media
- All images have descriptive alt text
- Decorative images use
alt="" - Videos have captions and transcripts
Semantic HTML
- Use
<header>,<nav>,<main>,<footer>landmarks - Add skip link to main content
- Proper heading hierarchy (H1 → H2 → H3)
Keyboard Navigation
- All interactive elements keyboard accessible
- Visible focus indicators
- Logical tab order
- No keyboard traps
Color & Contrast
- Text meets 4.5:1 contrast ratio (WCAG AA)
- Don’t rely on color alone to convey information
- Links distinguishable from text
Forms
- All inputs have labels
- Required fields marked
- Error messages accessible
- Use ARIA attributes appropriately
Related Pages
Content Rules
Content quality, heading structure, and readability
Core SEO Rules
Title tags, meta descriptions, and semantic HTML
Running Audits
Learn how to run accessibility audits
Audit Categories
Explore all 21 audit categories