Accessibility Writing
Accessibility Writing
Reference for writing content that is usable by screen-reader users, low-vision users, deaf and hard-of-hearing users, users with cognitive disabilities, and users on assistive tech.
The 8-point accessibility-writing test
- Headings form a proper outline. Exactly one
<h1>per page. No skipped levels. - Every image has an alt attribute. Decorative images use
alt="". Informative images get a 1–2 sentence description. - Every link reads as a self-contained label. “Click here,” “read more,” “learn more,” and bare URLs fail.
- Every form control has a programmatically associated label.
<label for>matched to inputid. - Every icon-only button has an accessible name.
aria-labeldescribing the action (“Close dialog,” not “X icon”). - Information is never conveyed by color alone. Status indicated by “Error: …” prefix or icon plus color.
- The page declares its language.
<html lang="en">. - Time-based media has alternatives. Video has synchronized captions and a transcript.
1. Alt text by image purpose
Decorative images — alt="" (empty, not missing).
Informative images — describe the information the image carries:
alt="CPU usage spikes to 95% at 14:30 UTC then returns to baseline by 14:35."
Functional images — describe the action or destination:
alt="View cart" (NOT alt="shopping cart icon")
Complex images — short alt plus a long description:
alt="Latency percentile chart for production over the past 24 hours."
Plus aria-describedby pointing to a <figcaption> with full details.
2. Heading structure
- One
<h1>per page. The page title. - No skipped levels going down. After
<h2>you may use another<h2>or an<h3>. You may not jump to<h5>. - Headings are not for styling. Don’t use
<h3>because it looks right. - Descriptive headings. “Introduction” fails WCAG 2.4.6. “How to reset your password” passes.
3. Link text
| Anti-pattern | Why it fails | Rewrite |
|---|---|---|
| “Click here” | No context out of place | “View the full pricing table” |
| “Read more” | All “Read more” links sound identical | “Read more about MongoDB Atlas Search” |
| “https://example.com/docs/atlas” | URLs are read aloud character by character | “Atlas documentation” |
- Don’t include the word “link” in link text. Screen readers already announce that an element is a link.
- For downloadable files, include the file format:
Download the Q1 incident report (PDF, 1.2 MB).
4. Form labels
<label for>matched to inputid. The most robust.- Wrapped
<label>. Works without explicitfor/id. aria-labelledbypointing at a visible element.aria-label. Last resort only when no visible label is possible.
5. Icon-only buttons
<!-- Right -->
<button aria-label="Close dialog">
<svg aria-hidden="true"><!-- X icon --></svg>
</button>
The aria-label describes what the button does (“Close dialog,” “Search,” “Open menu”). NOT what it looks like (“X,” “Magnifying glass”).
6. Color independence (WCAG 1.4.1)
- Status with a prefix word. “Error: Email is invalid.” “Warning: Unsaved changes.”
- Status with an icon plus color. A red X icon plus the word “Failed.”
- Links underlined as well as colored.
7. Captions, transcripts, audio descriptions
- 1.2.2 Captions (prerecorded), Level A. Synchronized captions for prerecorded video with audio.
- 1.2.4 Captions (live), Level AA. Live captions for live audio.
- 1.2.5 Audio description (prerecorded), Level AA. Audio description of prerecorded video.
8. Language tags
<html lang="en">
<p>The French phrase <span lang="fr">tour de force</span> means "feat of strength."</p>
9. The “skip to main content” link
<body>
<a href="#main" class="skip-link">Skip to main content</a>
<header>...</header>
<nav>...</nav>
<main id="main">...</main>
</body>
- The skip link is the first focusable element on the page.
- It is visually hidden until focused.
Reading-grade formulas as accessibility instruments
| Formula | Best for |
|---|---|
| Flesch-Kincaid Grade Level | General-audience web content, business writing |
| Gunning FOG Index | Business writing; enterprise plain-language audits |
| SMOG | Healthcare patient education (CDC, NIH, NCI), legal-adjacent disclosures |
References
- W3C WCAG 2.2: https://www.w3.org/WAI/WCAG22/quickref/
- W3C, Alternative Text Tutorial: https://www.w3.org/WAI/tutorials/images/
- W3C, Labeling Controls Tutorial: https://www.w3.org/WAI/tutorials/forms/labels/
- WebAIM, Creating Accessible Forms: https://webaim.org/techniques/forms/advanced
- The A11y Project, Patterns: https://www.a11yproject.com/patterns/
- Section 508: https://www.section508.gov/