Accessibility Guides for WCAG 2.2 (A)
Learn how to identify and fix common accessibility issues flagged by Axe Core — so your pages are inclusive and usable for everyone. Also check our HTML Validation Guides.
Scrollable regions are created when a container element has CSS overflow set to scroll, auto, or similar values, and its content exceeds the container’s visible dimensions. Mouse users can simply scroll these regions with their scroll wheel or by clicking and dragging the scrollbar. However, keyboard-only users need to be able to focus the scrollable region before they can scroll it with arrow keys or other keyboard controls.
Not all browsers automatically place scrollable regions in the tab order. Safari, notably, does not add scrollable <div> elements to the keyboard focus sequence unless they are explicitly made focusable or contain a focusable child. This means that without intervention, keyboard users in affected browsers are completely locked out of the scrollable content — they can see it but have no way to access it.
Who is affected
This issue has a serious impact on several groups of users:
- Keyboard-only users (including people with motor disabilities) cannot scroll to content hidden within the overflow region.
- Blind and deafblind users who rely on screen readers and keyboard navigation may be unable to reach or read content inside the scrollable area.
- Users of alternative input devices that emulate keyboard interaction are similarly blocked.
Related WCAG success criteria
This rule relates to the following WCAG 2.0 / 2.1 / 2.2 Level A success criteria:
- 2.1.1 Keyboard — All functionality must be operable through a keyboard interface without requiring specific timings for individual keystrokes.
- 2.1.3 Keyboard (No Exception) — All functionality must be operable through a keyboard with no exceptions.
Both criteria require that every interactive or content-bearing part of a page be fully usable via keyboard alone.
How to fix it
The most reliable approach is to make the scrollable region itself focusable by adding tabindex="0" to it. This ensures the element appears in the tab order and can receive keyboard focus, allowing the user to scroll with arrow keys.
Alternatively, you can ensure the scrollable region contains at least one focusable element (such as a link, button, or an element with tabindex="0"). If a child element can receive focus, keyboard users can tab into the scrollable region and then use arrow keys or other keyboard shortcuts to scroll.
Important: If the scrollable region contains interactive elements like <input>, <select>, or <textarea>, but all of them have tabindex="-1", the region has no keyboard-accessible entry point and will fail this rule. Either remove the negative tabindex from at least one child, or add tabindex="0" to the scrollable container itself.
When you make a scrollable container focusable, also consider adding an accessible name via aria-label or aria-labelledby so screen reader users understand the purpose of the focusable region. You may also want to add role="region" to help convey its purpose.
Examples
Failing: scrollable region with no focusable elements
All interactive children have tabindex="-1", and the container itself is not focusable. Keyboard users cannot reach or scroll this content.
<div style="height: 100px; overflow: auto;">
<input type="text" tabindex="-1" />
<select tabindex="-1"></select>
<p style="height: 500px;">
This content overflows but is unreachable by keyboard.
</p>
</div>
Failing: scrollable region with only static content
The container has overflow but no focusable element inside, and no tabindex on the container.
<div style="height: 100px; overflow-y: auto;">
<p style="height: 500px;">
Long content that requires scrolling to read fully.
</p>
</div>
Passing: focusable scrollable container
Adding tabindex="0" to the scrollable container allows keyboard users to focus it and scroll with arrow keys. An aria-label and role="region" provide context for screen reader users.
<div
style="height: 100px; overflow-y: auto;"
tabindex="0"
role="region"
aria-label="Scrollable content"
>
<p style="height: 500px;">
Long content that requires scrolling to read fully.
</p>
</div>
Passing: focusable child inside scrollable region
If you prefer not to make the container focusable, ensure at least one child element inside it can receive focus.
<div style="height: 100px; overflow-y: auto;">
<a href="#section1">Jump to section</a>
<p style="height: 500px;">
Long content that requires scrolling to read fully.
</p>
</div>
Conditional: interactive children without negative tabindex
If the scrollable region contains naturally focusable elements (like an <input>) without tabindex="-1", keyboard users can tab into the region. However, be aware that some browsers may intercept keyboard events for autocomplete, which can interfere with scrolling. Adding tabindex="0" directly to the scrollable container is the more robust solution.
<div style="height: 100px; overflow-y: scroll;">
<input type="text" />
<p style="height: 500px;">Additional content below the input.</p>
</div>
When a <select> element lacks an accessible name, screen readers announce it as something generic like “combobox” or “listbox” with no context about what it represents. A sighted user might see nearby text like “Country” and understand the purpose, but that visual proximity means nothing to assistive technology unless a programmatic relationship exists between the text and the form control.
This issue critically affects users who are blind, have low vision, or have mobility impairments and rely on assistive technologies to interact with forms. Without a proper label, these users cannot determine what data a dropdown expects, making form completion error-prone or impossible.
Related WCAG Success Criteria
This rule maps to WCAG 2.0, 2.1, and 2.2 Success Criterion 4.1.2: Name, Role, Value (Level A), which requires that all user interface components have a name that can be programmatically determined. It also falls under Section 508 §1194.22(n), which mandates that online forms allow people using assistive technology to access all field elements, directions, and cues needed for completion.
How to Fix It
There are several ways to give a <select> element an accessible name, listed here from most preferred to least preferred:
-
Explicit
<label>withfor/id— The most common and recommended approach. Use theforattribute on the<label>to match theidof the<select>. This also gives sighted users a larger click target. -
Implicit
<label>wrapping — Wrap the<select>inside a<label>element. Nofor/idpairing is needed. -
aria-labelledby— Point to theidof an existing visible text element that serves as the label. Useful when a traditional<label>would break layout or when multiple elements combine to form the label. -
aria-label— Provide an invisible text label directly on the<select>. Use this only when no visible label text exists or is appropriate.
Whichever method you choose, make sure:
- The label text clearly describes what the user should select.
-
Each
idattribute is unique on the page. -
Each
<select>has only one labeling method to avoid conflicts or confusion.
Examples
Incorrect: No Label Association
This places text near the <select> but creates no programmatic link between them. Screen readers will not announce “State” when the user focuses the dropdown.
State:
<select>
<option value="ny">New York</option>
<option value="ca">California</option>
</select>
Correct: Explicit <label> with for and id
The for attribute on the <label> matches the id on the <select>, creating a clear programmatic association.
<label for="state">State:</label>
<select id="state">
<option value="ny">New York</option>
<option value="ca">California</option>
</select>
Correct: Implicit <label> Wrapping
Wrapping the <select> inside the <label> element implicitly associates them.
<label>
State:
<select>
<option value="ny">New York</option>
<option value="ca">California</option>
</select>
</label>
Correct: Using aria-labelledby
When visible text already exists elsewhere (e.g., in a heading or table cell), use aria-labelledby to reference it by id.
<span id="state-label">State:</span>
<select aria-labelledby="state-label">
<option value="ny">New York</option>
<option value="ca">California</option>
</select>
Correct: Using aria-label
When no visible label is present or appropriate, aria-label provides an accessible name directly. Note that this label is invisible to sighted users, so only use it when context is already visually clear.
<select aria-label="State">
<option value="ny">New York</option>
<option value="ca">California</option>
</select>
A server-side image map is created when an <img> element includes the ismap attribute inside an <a> element. When a user clicks the image, the browser sends the x and y coordinates of the click to the server, which then determines what action to take. This approach has two critical accessibility failures:
-
No keyboard access. Because the interaction depends on mouse coordinates, there is no way for keyboard-only users to activate specific regions of the map. Keyboard users cannot generate coordinate-based clicks, so every link within the image map becomes unreachable.
-
No text alternatives for individual regions. Screen readers cannot identify or announce the distinct clickable areas within a server-side image map. Unlike client-side image maps, where each
<area>element can have analtattribute describing its purpose, server-side image maps offer no mechanism to label individual hotspots. This leaves blind and deafblind users unable to understand or interact with the content.
Users with mobility impairments who rely on switch devices or other keyboard-based assistive technologies are also affected, as these tools cannot produce the precise mouse coordinates that server-side image maps require.
This rule relates to WCAG 2.1 / 2.2 Success Criterion 2.1.1 (Keyboard) at Level A, which requires that all functionality be operable through a keyboard interface. It also aligns with Section 508 §1194.22(f), which explicitly states that client-side image maps must be provided instead of server-side image maps except where regions cannot be defined with an available geometric shape.
How to Fix
Replace every server-side image map with a client-side image map:
-
Remove the
ismapattribute from the<img>element. -
Remove the wrapping
<a>element (if it was only used for the server-side map). -
Add a
usemapattribute to the<img>element, referencing a<map>element by name. -
Define each clickable region using
<area>elements inside the<map>, specifying theshape,coords,href, andaltattributes for each one. -
Ensure every
<area>has a meaningfulaltattribute describing the link destination.
Examples
Incorrect: Server-side image map
The ismap attribute makes this a server-side image map. Keyboard users cannot access the links, and no text alternatives exist for individual regions.
<a href="/maps/nav.map">
<img src="/images/navbar.gif" alt="Navigation bar" ismap>
</a>
Correct: Client-side image map
Each clickable region is defined with an <area> element that has its own alt text and href. Keyboard users can tab through the areas, and screen readers can announce each link.
<img
src="/images/solar_system.jpg"
alt="Solar System"
width="472"
height="800"
usemap="#solar-system-map">
<map name="solar-system-map">
<area
shape="rect"
coords="115,158,276,192"
href="https://en.wikipedia.org/wiki/Mercury_(planet)"
alt="Mercury">
<area
shape="rect"
coords="115,193,276,234"
href="https://en.wikipedia.org/wiki/Venus"
alt="Venus">
<area
shape="rect"
coords="115,235,276,280"
href="https://en.wikipedia.org/wiki/Earth"
alt="Earth">
</map>
Correct: Simple navigation using a client-side image map
<img
src="/images/navbar.gif"
alt="Site navigation"
width="600"
height="50"
usemap="#nav-map">
<map name="nav-map">
<area
shape="rect"
coords="0,0,150,50"
href="/home"
alt="Home">
<area
shape="rect"
coords="150,0,300,50"
href="/products"
alt="Products">
<area
shape="rect"
coords="300,0,450,50"
href="/about"
alt="About us">
<area
shape="rect"
coords="450,0,600,50"
href="/contact"
alt="Contact">
</map>
In the client-side examples, each <area> is focusable via keyboard, has a descriptive alt attribute for screen readers, and links directly to its destination without requiring server-side coordinate processing. If your image map regions are complex and cannot be represented with the available shape values (rect, circle, poly), consider replacing the image map entirely with a set of individual links or buttons, which provide even better accessibility.
The <summary> element serves as a built-in disclosure widget in HTML. It functions like a button: users click or activate it to expand or collapse the associated <details> content. Because it’s an interactive control, it must communicate its purpose to all users, including those who rely on assistive technology.
When a <summary> element has no accessible name — for example, when it’s empty or contains only a non-text element without an alternative — screen readers will announce it as something generic like “disclosure triangle” or simply “button” with no label. This leaves blind and deafblind users unable to understand what the control does or what information it reveals. They may skip it entirely, missing potentially important content.
This rule maps to WCAG 2.0, 2.1, and 2.2 Success Criterion 4.1.2: Name, Role, Value (Level A), which requires that all user interface components have a programmatically determinable name. It also applies under Section 508, Trusted Tester guidelines, and EN 301 549 (9.4.1.2). The user impact is considered serious because it directly blocks access to content for assistive technology users.
How to fix it
The simplest and most reliable approach is to place descriptive text directly inside the <summary> element. This text should clearly indicate the topic or purpose of the hidden content.
If the <summary> element cannot contain visible text — for instance, when it uses a CSS background image or an icon — you can provide a hidden accessible name using one of these methods:
-
aria-label: Provide the accessible name directly as an attribute value. -
aria-labelledby: Point to another element’sidthat contains the accessible name text. -
title: Supply a tooltip that also serves as the accessible name. Note thattitleis the least reliable option, as it’s not consistently exposed across all assistive technologies.
Note that the summary-name rule is separate from the button-name rule because <summary> elements have different inherent semantics than <button> elements, even though both are interactive controls.
Examples
Failing: empty <summary> element
This <summary> has no text or accessible name, so screen readers cannot convey its purpose.
<details>
<summary></summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
Failing: <summary> with only a non-text element and no alternative
The image inside the <summary> has no alt text, so there is still no accessible name.
<details>
<summary>
<img src="info-icon.png">
</summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
Passing: <summary> with visible text
The most straightforward fix — place clear, descriptive text inside the <summary>.
<details>
<summary>Return policy</summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
Passing: <summary> with an image that has alt text
When using an image inside <summary>, the alt attribute provides the accessible name.
<details>
<summary>
<img src="info-icon.png" alt="Return policy">
</summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
Passing: <summary> with aria-label
When visible text isn’t feasible, aria-label provides a hidden accessible name.
<details>
<summary aria-label="Return policy"></summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
Passing: <summary> with aria-labelledby
The aria-labelledby attribute references another element that contains the name text.
<span id="return-heading" hidden>Return policy</span>
<details>
<summary aria-labelledby="return-heading"></summary>
<p>Returns must be initiated within 30 days of purchase.</p>
</details>
When an <svg> element is given a semantic role like img, graphics-document, or graphics-symbol, it signals to assistive technologies that the element conveys meaningful content — just like an <img> tag would. However, unlike <img> elements that have a straightforward alt attribute, SVG elements require different techniques to provide their accessible name. If no text alternative is supplied, screen reader users will encounter the SVG as an unlabeled graphic, losing access to whatever information it communicates.
This issue affects people who are blind, deafblind, or who use screen readers for other reasons. It can also impact users of braille displays and other assistive technologies that rely on programmatically determined text to represent non-text content.
Related WCAG Success Criteria
This rule maps to WCAG Success Criterion 1.1.1: Non-text Content (Level A), which requires that all non-text content presented to the user has a text alternative that serves the equivalent purpose. This criterion applies across WCAG 2.0, 2.1, and 2.2, and is also required by Section 508 and EN 301 549.
Because this is a Level A requirement, it represents the most fundamental level of accessibility. Failing to meet it means some users will have no way to understand the content your SVG conveys.
How to Fix It
There are several ways to give an <svg> element an accessible text alternative. Use one of the following approaches:
Use a <title> child element
The <title> element must be a direct child of the <svg> element. It provides a short text description that assistive technologies can read. If there are multiple <title> children, the first one must contain text — only the first <title> is used.
Use the aria-label attribute
Add an aria-label attribute directly to the <svg> element with a concise description of the graphic’s content.
Use the aria-labelledby attribute
Reference one or more existing elements on the page by their id values using aria-labelledby. This is especially useful when the description text is already visible elsewhere on the page.
Use the title attribute
The title attribute on the <svg> element can also provide an accessible name, though <title> child elements or ARIA attributes are generally preferred for better screen reader support.
How the Rule Works
The axe rule checks that the <svg> element with a role of img, graphics-document, or graphics-symbol has a computable accessible name. Specifically, it looks for:
-
A direct
<title>child element with non-empty text content -
An
aria-labelattribute with a non-empty value -
An
aria-labelledbyattribute that references elements with text content
The check fails if:
-
There is no
<title>child and no ARIA labeling attribute -
The
<title>child is empty or contains only whitespace -
The
<title>element is a grandchild (nested inside another element within the SVG) rather than a direct child -
There are multiple
<title>elements and the first one is empty
Examples
Failing — SVG with role="img" and no text alternative
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Screen readers will announce this as an image but cannot describe its content.
Failing — Empty <title> element
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<title></title>
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Failing — <title> is a grandchild, not a direct child
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<g>
<title>A blue circle</title>
<circle cx="50" cy="50" r="40" fill="blue" />
</g>
</svg>
The <title> must be a direct child of the <svg> element itself.
Failing — First <title> is empty
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<title></title>
<title>A blue circle</title>
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Only the first <title> child is evaluated. Since it is empty, the rule fails even though the second one has text.
Passing — Using a <title> child element
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<title>A blue circle</title>
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Passing — Using aria-label
<svg role="img" aria-label="A blue circle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Passing — Using aria-labelledby
<h2 id="chart-heading">Monthly Sales Data</h2>
<svg role="img" aria-labelledby="chart-heading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
<rect x="10" y="50" width="30" height="50" fill="green" />
<rect x="50" y="20" width="30" height="80" fill="green" />
</svg>
Passing — Decorative SVG excluded from the accessibility tree
If an SVG is purely decorative and conveys no meaning, you can hide it from assistive technologies instead of adding a text alternative:
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="blue" />
</svg>
Note that this approach removes the role="img" and adds aria-hidden="true", so the rule no longer applies. Only use this for truly decorative graphics — if the SVG conveys any information, it needs a text alternative.
The headers attribute is one of the primary ways to programmatically associate data cells with their corresponding header cells in HTML tables. It works by referencing the id values of th elements. When these references point to elements outside the table — or to id values that don’t exist at all — the association breaks, and assistive technology can no longer convey the relationship between data and headers.
This primarily affects users who are blind or deafblind and rely on screen readers. When navigating a data table, screen readers announce the relevant column and row headers as users move from cell to cell. This “table navigation mode” is essential for understanding the data in context. If the headers attribute references are broken, users may hear no header announcements or incorrect ones, making it impossible to interpret the data.
This rule relates to WCAG 2.0, 2.1, and 2.2 Success Criterion 1.3.1: Info and Relationships (Level A), which requires that information, structure, and relationships conveyed visually are also available programmatically. It also applies to Section 508 requirements that row and column headers be identified for data tables and that markup be used to associate data cells with header cells in tables with two or more logical levels of headers.
How to Fix the Problem
There are three common approaches to associating headers with data cells:
Use the scope attribute (simplest approach)
For straightforward tables, adding scope="col" to column headers and scope="row" to row headers is the easiest and most reliable method. No id or headers attributes are needed.
Use id and headers attributes (for complex tables)
For tables with multiple levels of headers or irregular structures, you can assign an id to each th element and then list the relevant id values in each td‘s headers attribute. The critical rule is: every id referenced in a headers attribute must belong to a th in the same <table> element.
Use scope="colgroup" and scope="rowgroup"
For tables with headers that span multiple columns or rows, the colgroup and rowgroup values of scope can indicate which group of columns or rows a header applies to.
Examples
Incorrect: headers attribute references an id outside the table
In this example, the headers attribute on data cells references id="name", which exists on an element outside the table. This will trigger the rule violation.
<h2 id="name">Name</h2>
<table>
<tr>
<th id="time">Time</th>
</tr>
<tr>
<td headers="name time">Mary - 8:32</td>
</tr>
</table>
Incorrect: headers attribute references a non-existent id
Here, headers="runner" refers to an id that doesn’t exist anywhere in the table.
<table>
<tr>
<th id="name">Name</th>
<th id="time">1 Mile</th>
</tr>
<tr>
<td headers="runner">Mary</td>
<td headers="runner time">8:32</td>
</tr>
</table>
Correct: Using scope for a simple table
For simple tables, scope is the preferred method and avoids the pitfalls of headers entirely.
<table>
<caption>Greensprings Running Club Personal Bests</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">1 Mile</th>
<th scope="col">5 km</th>
<th scope="col">10 km</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Mary</th>
<td>8:32</td>
<td>28:04</td>
<td>1:01:16</td>
</tr>
<tr>
<th scope="row">Betsy</th>
<td>7:43</td>
<td>26:47</td>
<td>55:38</td>
</tr>
</tbody>
</table>
Correct: Using id and headers for a complex table
When a table has multiple levels of headers, the headers attribute allows you to explicitly associate each data cell with the correct set of headers. All referenced id values are on th elements within the same table.
<table>
<caption>Items Sold August 2016</caption>
<thead>
<tr>
<td colspan="2"></td>
<th id="clothes" scope="colgroup" colspan="3">Clothes</th>
<th id="accessories" scope="colgroup" colspan="2">Accessories</th>
</tr>
<tr>
<td colspan="2"></td>
<th id="trousers" scope="col">Trousers</th>
<th id="skirts" scope="col">Skirts</th>
<th id="dresses" scope="col">Dresses</th>
<th id="bracelets" scope="col">Bracelets</th>
<th id="rings" scope="col">Rings</th>
</tr>
</thead>
<tbody>
<tr>
<th id="belgium" scope="rowgroup" rowspan="3">Belgium</th>
<th id="antwerp" scope="row">Antwerp</th>
<td headers="belgium antwerp clothes trousers">56</td>
<td headers="belgium antwerp clothes skirts">22</td>
<td headers="belgium antwerp clothes dresses">43</td>
<td headers="belgium antwerp accessories bracelets">72</td>
<td headers="belgium antwerp accessories rings">23</td>
</tr>
<tr>
<th id="gent" scope="row">Gent</th>
<td headers="belgium gent clothes trousers">46</td>
<td headers="belgium gent clothes skirts">18</td>
<td headers="belgium gent clothes dresses">50</td>
<td headers="belgium gent accessories bracelets">61</td>
<td headers="belgium gent accessories rings">15</td>
</tr>
<tr>
<th id="brussels" scope="row">Brussels</th>
<td headers="belgium brussels clothes trousers">51</td>
<td headers="belgium brussels clothes skirts">27</td>
<td headers="belgium brussels clothes dresses">38</td>
<td headers="belgium brussels accessories bracelets">69</td>
<td headers="belgium brussels accessories rings">28</td>
</tr>
</tbody>
</table>
In this complex example, each data cell’s headers attribute lists the id values of every relevant header — the country group, the city, the product category, and the specific product. Every referenced id belongs to a th within the same <table>, so the associations are valid and screen readers can announce the full context for each cell.
Tips for avoiding this issue
-
Double-check
idvalues. A common cause of this violation is a typo in either theidon thethor in theheadersattribute value on thetd. -
Don’t reuse
idvalues across tables. If you copy markup from one table to another, ensureidvalues are unique within the page and thatheadersattributes reference the correct table’sthelements. -
Prefer
scopewhen possible. For simple tables with a single row of column headers and/or a single column of row headers,scopeis simpler and less error-prone thanid/headers. -
Use
idandheadersfor genuinely complex tables — those with multiple header levels, merged cells, or irregular structures wherescopealone cannot convey all relationships.
Screen readers rely on the programmatic relationships between header cells and data cells to help users navigate and understand tabular data. As a user moves through a table, the screen reader announces the relevant column or row header for each data cell, giving context to what would otherwise be just a raw value. When a <th> element doesn’t properly refer to any data cells, the screen reader either announces incorrect headers, skips the header entirely, or produces confusing output.
This primarily affects blind and deafblind users who depend on screen readers to interpret table structure. Without correct header associations, these users cannot understand what each piece of data represents or how it relates to other data in the table.
Related Standards
This rule maps to WCAG 2.0, 2.1, and 2.2 Success Criterion 1.3.1: Info and Relationships (Level A), which requires that information, structure, and relationships conveyed through presentation are programmatically determinable. A table header that doesn’t actually reference any data cells fails to convey the intended structural relationship.
It also relates to Section 508 requirements that row and column headers be identified for data tables, and that markup be used to associate data cells and header cells. The Trusted Tester guidelines similarly require that all data cells are programmatically associated with relevant headers.
How to Fix It
-
Use the correct
scopevalue on<th>elements. If the header applies to a column, usescope="col". If it applies to a row, usescope="row". A common mistake is usingscope="row"on column headers or vice versa, which means the header doesn’t actually point to any data cells in the intended direction. -
Ensure every
<th>has data cells to reference. A<th>that sits in a position where it has no associated<td>elements (e.g., an empty row or column) should either be restructured or converted to a<td>. -
For simple tables, use
scopeon<th>elements. This is the simplest and most reliable approach when there is a single row of column headers and/or a single column of row headers. -
For complex tables with multiple levels of headers, use
idandheadersattributes. Assign a uniqueidto each<th>, then reference the appropriateidvalues in theheadersattribute of each<td>. Note that<th>elements themselves should not use theheadersattribute to reference other<th>elements — keepheaderson<td>elements. -
If using
headersattributes, ensure the referencedidvalues point to elements with text content that is available to screen readers.
Examples
Incorrect: scope="row" Used on Column Headers
In this example, the <th> elements are column headers, but they are incorrectly scoped to row. This means the headers don’t reference the data cells below them, so screen readers cannot associate “Last Name,” “First Name,” or “City” with their respective columns.
<table>
<caption>Teddy bear collectors</caption>
<tr>
<th scope="row">Last Name</th>
<th scope="row">First Name</th>
<th scope="row">City</th>
</tr>
<tr>
<td>Phoenix</td>
<td>Imari</td>
<td>Henry</td>
</tr>
<tr>
<td>Zeki</td>
<td>Rome</td>
<td>Min</td>
</tr>
</table>
Correct: scope="col" Used on Column Headers
The fix is straightforward — change scope="row" to scope="col" so the headers correctly reference the data cells beneath them.
<table>
<caption>Teddy bear collectors</caption>
<tr>
<th scope="col">Last Name</th>
<th scope="col">First Name</th>
<th scope="col">City</th>
</tr>
<tr>
<td>Phoenix</td>
<td>Imari</td>
<td>Henry</td>
</tr>
<tr>
<td>Zeki</td>
<td>Rome</td>
<td>Min</td>
</tr>
</table>
Correct: Using Both Column and Row Headers
When a table has headers in both the first row and the first column, use scope="col" for the column headers and scope="row" for the row headers.
<table>
<caption>Quarterly sales (in thousands)</caption>
<tr>
<td></td>
<th scope="col">Q1</th>
<th scope="col">Q2</th>
<th scope="col">Q3</th>
</tr>
<tr>
<th scope="row">Widgets</th>
<td>50</td>
<td>80</td>
<td>120</td>
</tr>
<tr>
<th scope="row">Gadgets</th>
<td>30</td>
<td>45</td>
<td>60</td>
</tr>
</table>
Correct: Complex Table Using id and headers
For tables with multiple levels of headers, use the id and headers approach to create explicit associations.
<table>
<caption>Student exam results</caption>
<tr>
<td></td>
<th id="math" scope="col">Math</th>
<th id="science" scope="col">Science</th>
</tr>
<tr>
<th id="maria" scope="row">Maria</th>
<td headers="maria math">95</td>
<td headers="maria science">88</td>
</tr>
<tr>
<th id="james" scope="row">James</th>
<td headers="james math">72</td>
<td headers="james science">91</td>
</tr>
</table>
In this example, each <td> explicitly references both its row header and column header, so a screen reader can announce something like “Maria, Math, 95” as the user navigates the table.
Captions are the primary way deaf and hard-of-hearing users access the audio portion of video content. When a video lacks captions, these users can see the visual content but miss everything communicated through sound — including spoken dialogue, narration, music, ambient sounds, and sound effects that provide context or meaning. This creates a critical barrier to understanding.
This rule relates to WCAG 2.0/2.1/2.2 Success Criterion 1.2.2: Captions (Prerecorded) at Level A, which requires that captions be provided for all prerecorded audio content in synchronized media. It is also required under Section 508 and EN 301 549. Because this is a Level A requirement, it represents the minimum baseline for accessibility — failing to provide captions is one of the most impactful accessibility issues a video can have.
Captions vs. Subtitles
It’s important to understand the difference between captions and subtitles, as they serve different purposes:
-
Captions (
kind="captions") are designed for deaf and hard-of-hearing users. They include all dialogue plus descriptions of meaningful non-speech audio such as sound effects, music, speaker identification, and other auditory cues (e.g., “[door slams]”, “[dramatic orchestral music]”, “[audience applause]”). -
Subtitles (
kind="subtitles") are language translations of dialogue and narration, intended for hearing users who don’t understand the spoken language. Subtitles generally do not include non-speech audio descriptions.
For accessibility compliance, you must use kind="captions", not kind="subtitles".
What Makes Good Captions
Good captions go beyond transcribing dialogue. They should:
- Identify who is speaking when it’s not visually obvious
- Include meaningful sound effects (e.g., “[phone ringing]”, “[glass shattering]”)
- Describe music when it’s relevant (e.g., “[soft piano music]”, “[upbeat pop song playing]”)
- Note significant silence or pauses when they carry meaning
- Be accurately synchronized with the audio
- Use proper spelling, grammar, and punctuation
How to Fix the Problem
Add a <track> element inside your <video> element with the following attributes:
-
src— the URL of the caption file (typically in WebVTT.vttformat) -
kind— set to"captions" -
srclang— the language code of the captions (e.g.,"en"for English) -
label— a human-readable label for the track (e.g.,"English")
Only src is technically required, but kind, srclang, and label are strongly recommended for clarity and to ensure assistive technologies and browsers handle the track correctly.
Examples
Incorrect: Video with no captions
<video width="640" height="360" controls>
<source src="presentation.mp4" type="video/mp4">
</video>
This video has no <track> element, so deaf and hard-of-hearing users cannot access any of the audio content.
Incorrect: Using subtitles instead of captions
<video width="640" height="360" controls>
<source src="presentation.mp4" type="video/mp4">
<track src="subs_en.vtt" kind="subtitles" srclang="en" label="English">
</video>
While this provides a text track, kind="subtitles" does not satisfy the captions requirement. Subtitles typically include only dialogue and won’t convey non-speech audio information.
Correct: Video with captions
<video width="640" height="360" controls>
<source src="presentation.mp4" type="video/mp4">
<track src="captions_en.vtt" kind="captions" srclang="en" label="English">
</video>
Correct: Video with captions in multiple languages
<video width="640" height="360" controls>
<source src="presentation.mp4" type="video/mp4">
<track src="captions_en.vtt" kind="captions" srclang="en" label="English" default>
<track src="captions_es.vtt" kind="captions" srclang="es" label="Español">
</video>
The default attribute indicates which caption track should be active by default when the user has captions enabled.
Example WebVTT Caption File
A basic captions_en.vtt file looks like this:
WEBVTT
00:00:01.000 --> 00:00:04.000
[upbeat music playing]
00:00:05.000 --> 00:00:08.000
Sarah: Welcome to our annual conference!
00:00:09.000 --> 00:00:12.000
[audience applause]
00:00:13.000 --> 00:00:17.000
Sarah: Today we'll explore three key topics.
Notice how the captions identify the speaker, describe non-speech sounds, and are synchronized to specific timestamps.
Ready to validate your sites?
Start your free trial today.