What accessibility is and how it works
Accessibility (a11y) is a property of a website that lets people with visual, hearing, motor, speech and cognitive impairments use it. The WCAG standard sets the requirements, and you test it with a keyboard and a screen reader.
Accessibility covers every kind of impairment that makes the web hard to use: hearing, cognitive, neurological, physical, speech and visual. It also helps people without disabilities: older people, someone with a broken arm, a user on a phone in bright sunlight or where sound cannot be turned on, anyone on a slow connection. Build it in from the start of the project: that way you will not have to rework a finished interface.
How people use the web
- A screen reader reads a page aloud or outputs it to a braille display.
- A screen magnifier enlarges part of the screen for people with low vision.
- Speech recognition and switches replace the keyboard and mouse for people who cannot use them.
- Keyboard only: many people do not use a mouse, and voice input works through the same keyboard commands.
- The user’s own techniques: larger text, captions, a slower mouse pointer.
A screen reader does not see the screen: it receives what the browser reports about the page. The browser builds a DOM tree from the markup, and from that an accessibility tree. Every object in it has a role (what it is: a button, a link, a list), a name (what to call it), a state (whether a checkbox is ticked, whether a disclosure is expanded) and a description. The screen reader gets this data through the operating system’s accessibility API. For a blind user, the accessibility tree is the page.
- The browser parses the HTML and builds a DOM tree.
- From the DOM tree the browser builds the accessibility tree: the role, name, state and description of each element.
- The operating system’s accessibility API passes this data to assistive technologies.
- The screen reader speaks the objects of the tree or outputs them to a braille display.
- The user controls the page from the keyboard, including with the screen reader’s own commands.
So start with correct HTML markup rather than extra attributes: screen readers handle headings, lists, links and buttons marked up with their own elements far better. When there is no suitable element, you need ARIA — it is covered in the section “ARIA: roles, names and states”.
How it differs from usability and inclusive design
| Approach | What it covers | How it differs |
|---|---|---|
| Accessibility | people with disabilities can perceive, understand, navigate and interact on an equal footing with others | technical requirements for code and design; the standard is WCAG |
| Usability | the product is effective, efficient and satisfying to use (ISO 9241-11) | concerns everyone and often overlooks people with disabilities |
| Inclusive design | as many people as possible taking part: technology, communications, education, language, age | broader than accessibility: disability is one of many topics |
The three approaches overlap, and W3C advises working on them together. But a usability test on its own will not find a blind user’s problems: you need both the WCAG requirements and testing with people with disabilities.
What to know in advance
- Semantic HTML elements — the HTML and CSS reference, section “Semantic markup”.
- Forms and input fields — the HTML and CSS reference, section “Forms and input fields”.
- Handling key presses in code — the JavaScript reference, section “Events”.
Section sources
the section is written from these pages- Introduction to Web Accessibilityw3.org/WAI/fundamentals/accessibility-intro/(opens in a new tab)
- Accessibility treedeveloper.mozilla.org/en-US/docs/Glossary/Accessibility_tree(opens in a new tab)
- Tools and Techniquesw3.org/WAI/people-use-web/tools-techniques/(opens in a new tab)
- Perception - hearing, feeling and seeingw3.org/WAI/people-use-web/tools-techniques/perception/(opens in a new tab)
- Accessibility, Usability, and Inclusionw3.org/WAI/fundamentals/accessibility-usability-inclusion/(opens in a new tab)