Accessibility
Make the site work for everyone with readable contrast, full keyboard use, visible focus, clear structure, calm motion, big touch targets and plain HTML first.
- Required 23
- Recommended 10
- Optional 1
- Avoid 1
Check the whole chapter at once with axe-core on every page type. Test the WCAG 2.0, 2.1 and 2.2 A and AA rules plus best practices. Run it at phone and desktop width, in light and dark mode. Automated tools find only part of the problems. Finish with a keyboard and a screen reader.
Required
Make text easy to read
RequiredGive text at least 4.5:1 contrast against its background, and 3:1 for large text and controls, in light and dark mode.
Describe images in words
RequiredGive every
<img>analtattribute. Say what it shows if it carries meaning, or leave it empty if it is decoration.Label every form field
RequiredGive every form field a visible label tied to it with
<label for>. A placeholder is not a label.Make everything work by keyboard
RequiredEvery link, button and control must work with just a keyboard. Tab moves in reading order, and focus never gets stuck.
Always show where focus is
RequiredShow a clear, high-contrast focus ring on every control when someone reaches it with the keyboard.
Never hide the focused element
RequiredMake sure a sticky header, banner or chat widget never hides the element that has keyboard focus. This is WCAG 2.2 criterion 2.4.11 (AA).
Let people skip to the content
RequiredMake a "Skip to main content" link the first thing that takes focus on every page.
Use the right element for the job
RequiredUse landmark elements (
header,nav,main,footer) and the right element for each job, with onemainper page.Say where each link goes
RequiredWrite link text that says where the link goes. Never write "click here" or "read more".
Never use colour as the only signal
RequiredNever show meaning by colour alone, such as red for an error or a coloured line in a chart. Add text, an icon, a pattern or an underline. This is WCAG criterion 1.4.1 (A).
Name every link and button
RequiredNever ship a link or button without a name a screen reader can read. Give icon-only controls an
aria-label.Explain form errors next to the field
RequiredShow form errors as text next to the field, tie them to it with
aria-describedby, and say how to fix them.Make signing in easy for everyone
RequiredNever make signing in depend only on remembering, copying out or solving puzzles. Allow paste and password managers. This is WCAG 2.2 criterion 3.3.8 (AA).
Never ask for the same thing twice
RequiredNever ask people for the same information twice in one process. Fill it in for them or let them pick it. This is WCAG 2.2 criterion 3.3.7 (A).
Keep help in the same place
RequiredPut help and contact links in the same place on every page. This is WCAG 2.2 criterion 3.2.6 (A).
Respect people who turn motion off
RequiredHonour
prefers-reduced-motionand stop or reduce animation, parallax and smooth scrolling. Never start motion by itself.Give people enough time
RequiredWarn people before a time limit runs out, and let them extend it with one simple action. Never move or update content by itself for more than five seconds without a way to pause it. These are WCAG criteria 2.2.1 and 2.2.2 (A).
Caption video, transcribe audio
RequiredCaption every video and give a transcript for audio.
Give tables headers
RequiredMark up data tables with
th,scopeand a caption or label. Use tables only for data, never for layout.Never make people scroll sideways
RequiredNever let a page or a component scroll sideways with a visible scrollbar, at any width from 320 px up.
Let text grow without breaking the page
RequiredKeep all content readable at 200% text zoom and with wider letter, word and line spacing. Never block pinch zoom. These are WCAG criteria 1.4.4 and 1.4.12 (AA).
Make tap targets big enough
RequiredMake every touch target at least 24 by 24 CSS pixels (WCAG AA), and 44 by 44 for main controls (WCAG AAA).
Offer a way that needs no dragging
RequiredGive every drag a single-pointer alternative, such as buttons. This is WCAG 2.2 criterion 2.5.7 (AA).
Recommended
Work in high-contrast mode
RecommendedTest the site in forced-colours mode, a high-contrast setting in Windows. Repair what it flattens under
forced-colors: active.Lock the page behind open menus
RecommendedMake everything behind an open menu or dialog unreachable with the
inertattribute.Reach for HTML before ARIA
RecommendedUse native HTML elements first. Add ARIA, extra attributes for screen readers, only for what no native element can say.
Make links look like links
RecommendedUnderline every text link in content with one subtle, consistent style. Leave it off only in navigation bars and on links styled as buttons, where the shape already says "link".
Announce changes without moving focus
RecommendedAnnounce changes such as "Copied" through a live region (
role="status") that is already in the page, without moving focus.Know which accessibility law applies
RecommendedFind out which accessibility laws cover the site. Meet WCAG 2.2 AA, which includes the WCAG 2.1 AA level most laws point to.
Let find-in-page open hidden text
RecommendedHide folded content in a way find-in-page can still reach, such as
<details>orhidden="until-found".Show the right keyboard on phones
RecommendedGive inputs the right
type,inputmodeandautocomplete, and never block zoom on phones.Build with native controls
RecommendedBuild controls from native elements (
button,a,details,dialog,popover) instead of scripteddivs.Style from the state
RecommendedStyle interface state from the state itself with selectors like
:has(),:popover-openand[aria-expanded], not from toggled classes.
Optional
Let the browser pick readable text colour
OptionalLet the browser pick readable black or white text on brand colours with
contrast-color(), after a fallback you have checked.
Avoid
Fix the site instead of adding overlays
AvoidNever install an accessibility overlay widget. Fix the site itself.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/accessibility.