Accessibility Guides for Section 508
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.
An image map is an <img> element linked to a <map> element via the usemap attribute. Inside the <map>, individual <area> elements define clickable hotspots that function as links. Each of these <area> elements is essentially a link, and like all links, it must have an accessible name that describes its purpose.
Why This Is an Accessibility Problem
Screen readers cannot interpret graphical content. When a user navigates to a clickable <area> that lacks alternative text, the screen reader has no meaningful label to announce. In many cases, it will fall back to reading the link URL or the image filename — neither of which conveys the purpose of the link. This critically impacts:
- Blind users and deafblind users who rely entirely on screen readers to navigate and interact with content.
- Users with mobility impairments who use assistive technologies like switch devices or voice control, which depend on accessible names to identify interactive elements.
This rule relates to the following WCAG success criteria:
-
WCAG 2.4.4 – Link Purpose (In Context) (Level A): The purpose of each link must be determinable from the link text alone, or from the link text combined with its programmatically determined context. An
<area>without alternative text has no discernible purpose. -
WCAG 4.1.2 – Name, Role, Value (Level A): All user interface components must have a programmatically determined name. An
<area>element is an interactive component, so it requires an accessible name.
This rule also applies under Section 508, EN 301 549, and Trusted Tester requirements.
How to Fix It
Ensure every active <area> element inside a <map> has an accessible name by using one of these methods:
-
altattribute (preferred) — Add descriptivealttext directly to the<area>element. -
aria-labelattribute — Provide a text label viaaria-label. -
aria-labelledbyattribute — Reference another element that contains the label text.
The alt text should clearly describe the purpose or destination of the link, not the visual appearance of the hotspot region.
Also, make sure the parent <img> element has its own alt attribute describing the image as a whole.
Examples
Incorrect: <area> Elements Without Alternative Text
In this example, the <area> elements have no alt text. Screen readers cannot communicate what each clickable region does.
<img src="solar_system.jpg" alt="Solar System" width="472" height="800" usemap="#solar-map">
<map name="solar-map">
<area shape="rect" coords="115,158,276,192" href="https://example.com/mercury">
<area shape="rect" coords="115,193,276,234" href="https://example.com/venus">
<area shape="rect" coords="115,235,276,280" href="https://example.com/earth">
</map>
Correct: <area> Elements With alt Text
Each <area> now has a descriptive alt attribute that communicates the link’s purpose.
<img src="solar_system.jpg" alt="Solar System" width="472" height="800" usemap="#solar-map">
<map name="solar-map">
<area shape="rect" coords="115,158,276,192" href="https://example.com/mercury" alt="Mercury">
<area shape="rect" coords="115,193,276,234" href="https://example.com/venus" alt="Venus">
<area shape="rect" coords="115,235,276,280" href="https://example.com/earth" alt="Earth">
</map>
Correct: Using aria-label Instead of alt
<img src="floor_plan.png" alt="Office floor plan" width="600" height="400" usemap="#office-map">
<map name="office-map">
<area shape="rect" coords="0,0,200,200" href="/rooms/conference-a" aria-label="Conference Room A">
<area shape="rect" coords="200,0,400,200" href="/rooms/kitchen" aria-label="Kitchen">
</map>
Incorrect: Server-Side Image Map
Server-side image maps use the ismap attribute and rely on mouse click coordinates sent to the server. These are not keyboard accessible and provide no text alternatives for individual regions. Avoid this pattern entirely.
<a href="/maps/nav.map">
<img src="navbar.gif" alt="Navigation" ismap>
</a>
Instead, replace server-side image maps with client-side image maps (usemap and <map>) that include proper alt text on each <area>, or use a different navigational pattern altogether such as a standard list of links.
When an <audio> element lacks a captions track, all of the information it conveys — dialogue, narration, sound effects, musical cues, and speaker identification — becomes completely inaccessible to users who are deaf or deafblind. This is considered a critical accessibility issue because it blocks entire groups of users from accessing content.
This rule relates to WCAG Success Criterion 1.2.1: Audio-only and Video-only (Prerecorded) (Level A), which requires that a text alternative be provided for prerecorded audio-only content. It also falls under Section 508 requirements and EN 301 549. Level A criteria represent the most fundamental accessibility requirements — failing to meet them means significant barriers exist for users with disabilities.
Captions vs. Subtitles
It’s important to understand that captions and subtitles are not the same thing:
-
Captions (
kind="captions") are designed for deaf and hard-of-hearing users. They include dialogue, speaker identification, sound effects (e.g., “[door slams]”), musical cues (e.g., “[soft piano music]”), and other meaningful audio information. -
Subtitles (
kind="subtitles") are language translations intended for hearing users who don’t understand the spoken language. They typically include only dialogue and narration.
Because of this distinction, you must use kind="captions", not kind="subtitles", to satisfy this rule.
How to Fix It
-
Create a captions file (typically in WebVTT
.vttformat) that includes all meaningful audio information: who is speaking, what they say, and relevant non-speech sounds. -
Add a
<track>element inside your<audio>element. -
Set the
kindattribute to"captions". -
Set the
srcattribute to the path of your captions file. -
Use the
srclangattribute to specify the language of the captions. -
Use the
labelattribute to give the track a human-readable name.
While only src is technically required on a <track> element, including kind, srclang, and label is strongly recommended for clarity and proper functionality.
Examples
Incorrect: <audio> with no captions track
<audio controls>
<source src="podcast.mp3" type="audio/mp3">
</audio>
This fails the rule because there is no <track> element providing captions.
Incorrect: <track> with wrong kind value
<audio controls>
<source src="podcast.mp3" type="audio/mp3">
<track src="subs_en.vtt" kind="subtitles" srclang="en" label="English">
</audio>
This fails because kind="subtitles" does not satisfy the captions requirement. Subtitles are not a substitute for captions.
Correct: <audio> with a captions track
<audio controls>
<source src="podcast.mp3" type="audio/mp3">
<track src="captions_en.vtt" kind="captions" srclang="en" label="English Captions">
</audio>
Correct: <audio> with multiple caption tracks for different languages
<audio controls>
<source src="interview.mp3" type="audio/mp3">
<track src="captions_en.vtt" kind="captions" srclang="en" label="English Captions">
<track src="captions_es.vtt" kind="captions" srclang="es" label="Subtítulos en español">
</audio>
Providing captions in multiple languages ensures broader accessibility and is especially helpful when your audience speaks different languages.
Example WebVTT captions file
A basic captions_en.vtt file might look like this:
WEBVTT
00:00:01.000 --> 00:00:04.000
[Upbeat intro music]
00:00:04.500 --> 00:00:07.000
Host: Welcome to the show, everyone.
00:00:07.500 --> 00:00:10.000
Guest: Thanks for having me!
00:00:10.500 --> 00:00:12.000
[Audience applause]
Notice how the captions include speaker identification (Host:, Guest:), non-speech sounds ([Upbeat intro music], [Audience applause]), and the full dialogue. This level of detail is what makes captions effective for deaf and deafblind users.
The <blink> element was once used to draw attention to content by making it flash repeatedly. While it may have seemed like an eye-catching effect, it creates serious accessibility barriers for multiple groups of users. The element has been deprecated from the HTML specification, and although most modern browsers no longer render the blinking effect, the element should still be removed from your markup to ensure compliance and avoid issues in any environment that might still support it.
Why this is an accessibility problem
Blinking content affects several groups of users:
- Users with cognitive disabilities may find blinking text distracting or incomprehensible. The constant flashing can make it very difficult to focus on and understand the content.
- Users with low vision struggle to read text that appears and disappears rapidly. The intermittent visibility makes the content effectively unreadable.
- Users with motor disabilities may have difficulty clicking on blinking links or buttons, since the target is not consistently visible and requires precise timing to activate.
- Users with photosensitive conditions can experience discomfort or, in extreme cases, seizures from flashing content, depending on the frequency.
This rule relates to WCAG 2.2 Success Criterion 2.2.2: Pause, Stop, Hide (Level A), which requires that for any moving, blinking, or scrolling content that starts automatically and lasts more than five seconds, users must be able to pause, stop, or hide it. Since the <blink> element provides no mechanism for users to control the flashing, it fails this criterion outright.
This rule also applies to Section 508 §1194.22(j), which states that pages must be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and lower than 55 Hz.
How to fix it
-
Remove all
<blink>elements from your HTML. Replace them with standard elements like<span>,<strong>, or<em>. -
Remove
text-decoration: blink;from your CSS, as this is the CSS equivalent of the<blink>element. - Use alternative emphasis techniques to make content stand out — bold text, color, larger font size, borders, background highlights, or icons.
Important: Many modern browsers silently ignore the <blink> element, so the text won’t visually blink even though the element is present in the source code. Don’t rely on how the page looks in the browser to determine whether <blink> tags exist. Always check the actual HTML source.
Examples
Incorrect: using the <blink> element
<p><blink>Moving Sale Thursday!</blink></p>
This causes the text to flash on and off (in browsers that support it), making it inaccessible.
Incorrect: using text-decoration: blink in CSS
<style>
.attention {
text-decoration: blink;
}
</style>
<h2 class="attention">Limited Time Offer!</h2>
The CSS text-decoration: blink value achieves the same inaccessible effect as the <blink> element.
Correct: using static visual emphasis
<p><strong>Moving Sale Thursday!</strong></p>
Using <strong> makes the text bold and conveys emphasis to screen readers without any flashing.
Correct: using CSS for visual emphasis without blinking
<style>
.highlight {
background-color: #fff3cd;
border-left: 4px solid #ffc107;
padding: 8px 12px;
font-weight: bold;
}
</style>
<p class="highlight">Limited Time Offer!</p>
This draws attention to the content using color, a border, and bold text — all without any flashing or blinking, keeping the content readable and accessible for everyone.
When a button lacks an accessible name, assistive technologies like screen readers can only announce it generically — for example, as “button” — with no indication of its purpose. This is a critical barrier for people who are blind or deafblind, as they rely entirely on programmatically determined names to understand and interact with interface controls. A sighted user might infer a button’s purpose from an icon or visual context, but without a text-based name, that information is completely lost to assistive technology users.
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 is also covered by Section 508, EN 301 549 (9.4.1.2), and Trusted Tester guidelines, which require that the purpose of every link and button be determinable from its accessible name, description, or context.
How to fix it
Ensure every <button> element or element with role="button" has an accessible name through one of these methods:
- Visible text content inside the button element.
-
A non-empty
aria-labelattribute that describes the button’s purpose. -
An
aria-labelledbyattribute that references an element containing visible, non-empty text. -
A
titleattribute (use as a last resort, sincetitletooltips are inconsistently exposed across devices).
If a button is purely decorative and should be hidden from assistive technologies, you can assign role="presentation" or role="none" and remove it from the tab order with tabindex="-1". However, this is rare for interactive buttons.
Common mistakes to avoid
-
Leaving a
<button>element completely empty. -
Using only a
valueattribute on a<button>— unlike<input>elements, thevalueattribute on<button>does not provide an accessible name. -
Setting
aria-labelto an empty string (aria-label=""). -
Pointing
aria-labelledbyto an element that doesn’t exist or contains no text. - Using only an icon or image inside a button without providing alternative text.
Examples
Incorrect: empty button
<button id="search"></button>
A screen reader announces this as “button” with no indication of its purpose.
Incorrect: button with only a value attribute
<button id="submit" value="Submit"></button>
The value attribute does not set the accessible name for <button> elements.
Incorrect: empty aria-label
<button id="close" aria-label=""></button>
An empty aria-label results in no accessible name.
Incorrect: aria-labelledby pointing to a missing or empty element
<button id="save" aria-labelledby="save-label"></button>
<div id="save-label"></div>
The referenced element exists but contains no text, so the button has no accessible name.
Correct: button with visible text
<button>Submit order</button>
Correct: icon button with aria-label
<button aria-label="Close dialog">
<svg aria-hidden="true" focusable="false">
<use href="#icon-close"></use>
</svg>
</button>
The aria-label provides the accessible name, while aria-hidden="true" on the SVG prevents duplicate announcements.
Correct: button labeled by another element
<h2 id="section-title">Shopping cart</h2>
<button aria-labelledby="section-title">
<svg aria-hidden="true" focusable="false">
<use href="#icon-arrow"></use>
</svg>
</button>
The button’s accessible name is drawn from the referenced heading text.
Correct: button with aria-label and visible text
<button aria-label="Search products">Search</button>
When both aria-label and inner text are present, aria-label takes precedence as the accessible name. Use this when you need a more descriptive name than what the visible text alone conveys.
Correct: button with title (last resort)
<button title="Print this page">
<svg aria-hidden="true" focusable="false">
<use href="#icon-print"></use>
</svg>
</button>
The title attribute provides an accessible name, but visible text or aria-label are preferred because title tooltips may not be available to touch-screen or keyboard-only users.
Websites typically repeat navigation links, branding, and other interface elements across every page. While sighted mouse users can visually scan past these blocks and click wherever they want, keyboard-only users and screen reader users must navigate through every interactive element sequentially. Without a bypass mechanism, a keyboard user might need to press Tab dozens of times just to reach the primary content on each new page they visit. For users with severe motor impairments, this can take several minutes per page and cause fatigue or physical pain. Even users with less severe limitations will experience frustrating delays compared to mouse users, who can reach any link in a second or two.
Screen reader users also benefit significantly from bypass mechanisms. Landmarks like <main>, <nav>, and <header> allow screen readers to present a structural outline of the page, enabling users to jump directly to the section they need. Headings serve a similar purpose — screen reader users can navigate by heading level to quickly locate the main content area.
This rule maps to WCAG 2.4.1 Bypass Blocks (Level A), which requires that a mechanism is available to bypass blocks of content repeated on multiple pages. It is also required by Section 508 (specifically §1194.22(o)), the Trusted Tester guidelines, and EN 301 549. Because it is a Level A requirement, it represents the minimum baseline for accessibility compliance.
How the Rule Works
The axe bypass rule checks that a page includes at least one of the following:
-
A landmark region (such as
<main>,<nav>,<header>, or<footer>) -
A heading (an
<h1>through<h6>element) - An internal skip link (an anchor link that points to a location further down the page)
If none of these are present, the rule flags the page as a failure.
How to Fix It
The best approach is to use HTML5 landmark elements to structure your page. At a minimum, include a <main> element that wraps the primary content of the page. You should also use <header>, <nav>, and <footer> to identify other common sections. A page should have only one <main> landmark.
Additionally, consider adding a skip navigation link as the very first focusable element on the page. This provides an immediate shortcut for keyboard users who don’t use screen readers and may not be able to navigate by landmarks.
Prefer native HTML5 elements over their ARIA equivalents. For example, use <main> rather than <div role="main">. Native elements are better supported and require less code.
Examples
Incorrect: No Landmarks, Headings, or Skip Links
This page has no structural landmarks, no headings, and no skip link. Keyboard users must tab through every element to reach the content.
<div class="header">
<div class="logo">My Site</div>
<div class="nav">
<a href="/home">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</div>
</div>
<div class="content">
<p>This is the main content of the page.</p>
</div>
<div class="footer">
<p>Footer information</p>
</div>
Correct: Using HTML5 Landmark Elements
Replacing generic <div> wrappers with semantic HTML5 elements gives the page proper structure that assistive technologies can use for navigation.
<header>
<div class="logo">My Site</div>
<nav>
<a href="/home">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
<main>
<h1>Welcome</h1>
<p>This is the main content of the page.</p>
<section>
<h2>Latest News</h2>
<p>Section content here.</p>
</section>
</main>
<footer>
<p>Footer information</p>
</footer>
Correct: Adding a Skip Navigation Link
A skip link gives keyboard users an immediate way to bypass repeated content. It is typically visually hidden until it receives focus.
<body>
<a class="skip-link" href="#main-content">Skip to main content</a>
<header>
<nav>
<a href="/home">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
<main id="main-content">
<h1>Page Title</h1>
<p>This is the main content of the page.</p>
</main>
<footer>
<p>Footer information</p>
</footer>
</body>
.skip-link {
position: absolute;
left: -9999px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
.skip-link:focus {
position: static;
width: auto;
height: auto;
overflow: visible;
}
When the skip link receives keyboard focus, it becomes visible, and pressing Enter moves focus directly to the <main> element. Combined with proper landmark elements, this gives all users fast, reliable access to the page’s primary content.
Screen reader users can pull up a list of all frames on a page and navigate between them using their titles. When frames lack accessible names, users hear generic labels like “frame,” “JavaScript,” or a raw URL — none of which convey the purpose or content of the frame. This forces users to enter each frame just to figure out what it contains, which is time-consuming and frustrating.
This issue primarily affects users who are blind or deafblind and rely on assistive technology, but it also impacts users with mobility disabilities who navigate by frame lists or landmarks.
Relevant WCAG Success Criteria
This rule relates to WCAG 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. Frames are interactive containers that users navigate into and out of, so they must have an accessible name.
It is also explicitly required by Section 508 (§1194.22(i)), which states that frames shall be titled with text that facilitates frame identification and navigation.
How to Fix It
Give every <iframe> and <frame> element a clear, descriptive accessible name using one of these methods:
-
titleattribute — The most common approach. Add atitlethat briefly describes the frame’s content. -
aria-labelattribute — Provides an accessible name directly on the element. -
aria-labelledbyattribute — References another element’s text as the accessible name.
Tips for Writing Good Frame Titles
- Be brief and descriptive. A title like “Product search results” is far more useful than “frame1” or “content.”
- Make each title unique. If you have multiple frames, each one should have a distinct title so users can tell them apart.
-
Match the frame’s internal document title. Some screen readers replace the frame’s
titleattribute with the<title>element inside the framed document. For consistency, keep them the same or very similar. - Avoid placeholder text. Titles like “untitled” or “iframe” provide no useful information.
- Put unique information first. If you include a brand name, place it after the descriptive content so users hear the most useful information immediately.
Examples
Incorrect: <iframe> Without an Accessible Name
The frame has no title, aria-label, or aria-labelledby, so screen readers cannot describe it.
<iframe src="https://example.com/video-player"></iframe>
Incorrect: Empty title Attribute
An empty title is the same as having no title at all.
<iframe src="https://example.com/video-player" title=""></iframe>
Correct: Using the title Attribute
<iframe src="https://example.com/video-player" title="Product demo video player"></iframe>
Correct: Using aria-label
<iframe src="https://example.com/map" aria-label="Store location map"></iframe>
Correct: Using aria-labelledby
<h2 id="chat-heading">Live Chat Support</h2>
<iframe src="https://example.com/chat" aria-labelledby="chat-heading"></iframe>
Correct: Multiple Frames With Unique Titles
When a page contains several frames, each one should have a distinct, descriptive title.
<iframe src="/navigation" title="Site navigation menu"></iframe>
<iframe src="/content" title="Main article content"></iframe>
<iframe src="/ads" title="Sponsored advertisements"></iframe>
Correct: Matching the Frame Title to the Document Title
For the best experience, align the title attribute on the <iframe> with the <title> element inside the framed document.
<!-- Parent page -->
<iframe src="contact-form.html" title="Contact us form"></iframe>
<!-- contact-form.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Contact us form</title>
</head>
<body>
<h1>Contact Us</h1>
<form>
<label for="email">Email</label>
<input type="email" id="email">
<button type="submit">Send</button>
</form>
</body>
</html>
Images are a fundamental part of web content, but they are inherently visual. Screen readers cannot interpret the pixels of an image — they rely entirely on a text alternative to describe the image’s content and purpose to the user. Without alternative text, a screen reader may read out the image’s file name (e.g., “IMG_20230415_093012.jpg”), which is meaningless and confusing. In the worst case, the image is silently skipped, and the user misses critical information.
This rule primarily affects people who are blind or deafblind, who depend on screen readers or braille displays to access content. Users with low vision who rely on text magnification or high-contrast modes can also benefit from well-written alternative text.
Why This Matters
This rule maps to WCAG 2.2 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 an equivalent purpose. It is also required by Section 508 and EN 301 549. Because it is a Level A requirement, it represents the absolute minimum baseline for accessibility — failing it means your content is fundamentally inaccessible to many users.
How to Provide Alternative Text
There are three main techniques for giving an image accessible alternative text:
-
The
altattribute — the most common and preferred method for<img>elements. -
The
aria-labelattribute — provides an accessible name directly on the element. -
The
aria-labelledbyattribute — points to theidof another element that contains the descriptive text.
Writing Good Alt Text
When writing alternative text, consider these questions:
- Why is this image here? What role does it play in the content?
- What information does it convey? What would a sighted user take away from it?
- If you removed the image, what words would replace it to preserve the same meaning?
Keep alt text concise and descriptive. Avoid phrases like “image of” or “picture of” — screen readers already announce the element as an image. Don’t use the file name as alt text. Focus on the image’s purpose and meaning, not a pixel-by-pixel description.
Handling Decorative Images
Not every image carries meaning. Decorative images — such as visual separators, background flourishes, or images whose content is fully described in surrounding text — should be hidden from assistive technology. To do this, use an empty alt attribute: alt="".
Do not omit the alt attribute entirely. If alt is missing, screen readers will often fall back to reading the file name, which creates a worse experience than having no announcement at all. An empty alt="" explicitly tells the screen reader to skip the image.
You can also use role="presentation" or role="none" to mark an image as decorative, but an empty alt attribute is simpler and more widely supported.
Examples
Incorrect: Missing Alt Text
The alt attribute is completely absent. A screen reader may announce the file name instead.
<img src="team-photo.jpg">
Incorrect: Unhelpful Alt Text
The alt text contains the file name rather than a meaningful description.
<img src="chart-q3.png" alt="chart-q3.png">
Correct: Descriptive Alt Text Using the alt Attribute
<img src="team-photo.jpg" alt="The engineering team gathered around a whiteboard during a planning session">
Correct: Alt Text Using aria-label
<img src="revenue-chart.png" aria-label="Bar chart showing quarterly revenue increasing from $2M in Q1 to $3.5M in Q4">
Correct: Alt Text Using aria-labelledby
<p id="chart-desc">Bar chart showing quarterly revenue growth from Q1 to Q4 2024.</p>
<img src="revenue-chart.png" aria-labelledby="chart-desc">
Correct: Decorative Image with Empty Alt
This separator line serves no informational purpose and should be hidden from screen readers.
<img src="decorative-line.svg" alt="">
Correct: Decorative Image Using role="presentation"
<img src="decorative-swirl.png" role="presentation">
What This Rule Checks
This axe-core rule (image-alt) inspects every <img> element on the page and verifies that it has an accessible text alternative. Specifically, it checks that each <img> has at least one of the following:
-
A non-empty
altattribute -
An
aria-labelattribute -
An
aria-labelledbyattribute that references a valid element -
An empty
alt=""(orrole="presentation"/role="none") to indicate the image is decorative
If none of these conditions are met, the rule flags the image as a critical accessibility violation.
Every interactive control on a page needs an accessible name so that assistive technologies can announce it to users. For <input> elements with type="button", type="submit", or type="reset", the accessible name typically comes from the value attribute. While <input type="submit"> and <input type="reset"> have default browser-provided labels (“Submit” and “Reset”), <input type="button"> has no default — it renders as an empty, unlabeled button if no name is provided.
This issue critically affects blind and deafblind users who rely on screen readers. When a screen reader encounters an input button without discernible text, it may announce something like “button” with no indication of what the button does. This makes it impossible to navigate forms, submit data, or perform actions confidently. Sighted users can often infer a button’s purpose from visual context, but screen reader users depend entirely on the programmatic accessible name.
Related WCAG Success Criteria
This rule maps to WCAG 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 relates to Section 508 requirements that every non-text element must have a text equivalent, and EN 301 549 Section 9.4.1.2.
How to Fix It
There are several ways to give an input button a discernible accessible name:
-
valueattribute — The most straightforward approach. Setvalueto descriptive text that communicates the button’s purpose. -
aria-labelattribute — Provides an accessible name directly. Useful when you need the accessible name to differ from the visible text, or whenvaluecannot be used. -
aria-labelledbyattribute — References another element’sidwhose text content becomes the accessible name. The referenced element must exist and contain text. -
titleattribute — Acts as a fallback accessible name. However,titleis less reliable because it is not consistently exposed by all assistive technologies and only appears as a tooltip on hover, making it inaccessible to keyboard and touch users. Prefervalueoraria-labelinstead.
For <input type="submit"> and <input type="reset">, browsers provide default labels, so they pass without an explicit value. However, if you set value="" (an empty string), you override the default and create an empty accessible name, which fails.
Examples
Incorrect: Input button with no accessible name
<form action="/search">
<input type="button" id="go" />
</form>
This button has no value, aria-label, aria-labelledby, or title. A screen reader will announce it as just “button” with no context.
Incorrect: Empty aria-label
<form action="/search">
<input type="button" aria-label="" />
</form>
An empty aria-label does not provide a discernible name.
Incorrect: aria-labelledby referencing a nonexistent or empty element
<form action="/search">
<input type="button" aria-labelledby="nonexistent" />
</form>
<form action="/search">
<input type="button" aria-labelledby="empty-label" />
<div id="empty-label"></div>
</form>
If the referenced element doesn’t exist or has no text content, the button has no accessible name.
Incorrect: Submit or reset with an empty value
<form action="/search">
<input type="submit" value="" />
<input type="reset" value="" />
</form>
Setting value to an empty string overrides the browser’s default label, leaving the button unnamed.
Correct: Using the value attribute
<form action="/search">
<input type="button" value="Search" />
</form>
Correct: Using aria-label
<form action="/search">
<input type="button" aria-label="Search" />
</form>
Correct: Using aria-labelledby
<form action="/search">
<input type="button" aria-labelledby="btn-label" />
<span id="btn-label">Search</span>
</form>
Correct: Submit and reset with default or explicit values
<form action="/search">
<input type="submit" />
<input type="reset" />
<input type="submit" value="Send Form" />
<input type="reset" value="Clear All Fields" />
</form>
The first two rely on the browser’s built-in default labels (“Submit” and “Reset”). The last two provide custom, more descriptive labels through the value attribute. Both approaches are valid, though explicit descriptive labels are generally preferred for clarity.
An <input type="image"> element renders an image that functions as a submit button. Unlike standard <input type="submit"> buttons that display their value attribute as visible text, image buttons rely entirely on their visual appearance to communicate purpose. This means assistive technologies have no way to determine the button’s function unless you explicitly provide alternative text.
This is a critical accessibility barrier for several groups of users. Blind and deafblind users who rely on screen readers will hear something generic like “button” or, worse, the image file name (e.g., “btn_submit_v2.png”), which provides no useful information. Users with low vision who use screen magnifiers in combination with screen readers are similarly affected. Without a clear accessible name, these users cannot confidently interact with forms.
This rule relates to two WCAG success criteria at Level A — the minimum conformance level:
- WCAG 1.1.1 (Non-text Content): All non-text content must have a text alternative that serves the equivalent purpose. An image button is non-text content, so it needs alternative text.
- WCAG 4.1.2 (Name, Role, Value): All user interface components must have a programmatically determinable name. Buttons must expose their name to assistive technologies.
This requirement is also mandated by Section 508, EN 301 549, and the Trusted Tester guidelines.
How to fix it
Provide a non-empty accessible name for every <input type="image"> element using one of these methods:
-
altattribute (preferred): Add analtattribute that describes the button’s action. This is the most straightforward and widely supported approach. -
aria-labelattribute: Set anaria-labelwith a concise description of the button’s action. -
aria-labelledbyattribute: Reference theidof another visible element that describes the button’s action.
Writing effective alternative text
The alternative text for an image button should describe the action the button performs, not the image itself. Ask yourself: “What happens when the user clicks this button?” The answer is your alternative text.
- ✅ “Submit”, “Search”, “Add to cart”, “Log in”
- ❌ “Green arrow icon”, “button.png”, “click here”
Avoid filler words like “image of” or “button” — assistive technologies already announce the element’s role as a button.
Important: Simply placing text next to the image button in the HTML is not sufficient. Screen readers need a programmatically associated label, not visually adjacent text. Nearby text cannot be reliably determined as the button’s label by assistive technologies.
Examples
Incorrect: missing alternative text
The image button has no alt, aria-label, or aria-labelledby attribute. A screen reader might announce this as “submit.png button” or just “button.”
<form action="/search">
<label for="query">Search</label>
<input type="text" id="query" name="q">
<input type="image" src="search-icon.png">
</form>
Incorrect: empty alt attribute
An empty alt attribute tells assistive technologies to ignore the element, effectively hiding the button entirely.
<input type="image" src="search-icon.png" alt="">
Correct: using the alt attribute
<form action="/search">
<label for="query">Search</label>
<input type="text" id="query" name="q">
<input type="image" src="search-icon.png" alt="Search">
</form>
Correct: using aria-label
<input type="image" src="submit-arrow.png" aria-label="Submit order">
Correct: using aria-labelledby
The aria-labelledby attribute points to the id of a visible element. Make sure the referenced element exists and is not hidden with display: none or aria-hidden="true".
<h2 id="checkout-heading">Complete your purchase</h2>
<form action="/checkout">
<!-- form fields -->
<input type="image" src="checkout-btn.png" aria-labelledby="checkout-heading">
</form>
What the rule checks
This rule verifies that every <input type="image"> element has a discoverable accessible name. It fails if the element has no alt, aria-label, or aria-labelledby attribute, or if those attributes are empty or resolve to an empty string.
Every form element — such as text inputs, checkboxes, radio buttons, and select menus — must have a programmatically associated label so that assistive technologies can identify and announce the purpose of each field. Without these labels, screen reader users cannot determine what information is expected, and users with motor impairments lose the benefit of a larger clickable target area that a properly associated <label> provides.
Why This Matters
When a form element lacks a programmatic label, screen readers either announce it generically (e.g., “edit text” or “checkbox”) or skip meaningful context entirely. This leaves blind, low-vision, and deafblind users unable to understand what data a field expects or what option a checkbox represents. They must guess based on surrounding content, which is unreliable and error-prone.
Labels also benefit users with motor impairments. When a <label> element is properly associated with an input, clicking the label text activates or focuses the associated control. This creates a larger click target, which is especially helpful for people with limited dexterity.
Sighted users often rely on visual proximity to infer a field’s purpose, but assistive technologies need an explicit programmatic relationship between the label text and the form control to convey the same information.
Relevant Standards
This rule maps to WCAG Success Criterion 4.1.2: Name, Role, Value (Level A), which requires that all user interface components have an accessible name that can be programmatically determined. It applies across WCAG 2.0, 2.1, and 2.2, as well as Section 508 (§1194.22(n)), EN 301 549 (9.4.1.2), and Trusted Tester guidelines. The user impact is considered critical.
How to Fix It
There are several ways to associate a label with a form element. Use the approach that best fits your situation, listed here from most recommended to least recommended.
1. Explicit <label> with for and id (Recommended)
The most common and reliable method is to use a <label> element whose for attribute matches the id of the form control. This creates an unambiguous programmatic association.
2. Implicit <label> (Wrapping)
Wrap the form control inside a <label> element. The association is implied by the parent-child relationship.
3. aria-label
Use aria-label when the field’s purpose is conveyed visually through an icon or layout rather than visible text. This creates an invisible label that only screen readers announce.
4. aria-labelledby
Use aria-labelledby when the label text already exists elsewhere on the page, or when you need to combine multiple pieces of text into a single label. Reference one or more element id values.
5. placeholder (Not Recommended)
A placeholder attribute can technically provide an accessible name, but it disappears once the user begins typing, removing the visible label. This creates usability problems for everyone and is not a recommended approach.
General Tips
-
Ensure all
idvalues are unique on the page. - Make label text descriptive and meaningful when read aloud in isolation.
-
Remember that buttons (
<button>,<input type="submit">, etc.) are self-labeling through their text content orvalueattribute and do not need a separate<label>. -
Hidden inputs (
<input type="hidden">) do not need labels since they are not presented to users.
Examples
Incorrect: Input without a label
<div>First name:</div>
<input type="text" id="firstname">
The <div> text is visually near the input, but there is no programmatic relationship. A screen reader will announce only “edit text” with no context.
Correct: Explicit label with for and id
<label for="firstname">First name:</label>
<input type="text" id="firstname">
Correct: Implicit label by wrapping
<label>
First name:
<input type="text">
</label>
Correct: aria-label for visually implied fields
<input type="text" aria-label="Search">
<button type="submit">🔍</button>
Correct: aria-labelledby referencing existing text
<div id="temp-label">Temperature</div>
<div id="high-label">High:</div>
<div id="low-label">Low:</div>
<input type="text" aria-labelledby="temp-label high-label">
<input type="text" aria-labelledby="temp-label low-label">
The first input is announced as “Temperature High:” and the second as “Temperature Low:”, combining the referenced text in order.
Incorrect: Relying only on placeholder
<input type="text" placeholder="Enter your email">
While this technically provides an accessible name, the visible hint disappears when the user starts typing, making it difficult to verify the field’s purpose. Always prefer a persistent visible label.
Correct: Visible label with supplementary placeholder
<label for="email">Email address</label>
<input type="text" id="email" placeholder="name@example.com">
Incorrect: Checkbox without a label
<input type="checkbox" id="terms">
I agree to the terms and conditions
The text is adjacent but not associated with the checkbox.
Correct: Labeled checkbox
<input type="checkbox" id="terms">
<label for="terms">I agree to the terms and conditions</label>
Links are one of the most fundamental interactive elements on the web. When a link lacks an accessible name, screen reader users hear something like “link” with no further context, making it impossible to understand the link’s purpose or destination. This affects people who are blind, deafblind, or have low vision and rely on screen readers, as well as keyboard-only users who navigate through links sequentially.
A link’s accessible name can come from several sources: its visible text content, an aria-label attribute, an aria-labelledby reference, a title attribute, or the alt text of an image contained within it. If none of these provide a non-empty string, the link has no discernible text, and this rule will flag it.
Beyond just having text, links must also be programmatically focusable. Avoid relying on device-specific JavaScript events like onmouseover or mouseout(), which are inaccessible to keyboard users. Use device-independent alternatives like onfocus, onblur, focus(), and blur(). Additionally, don’t hide link text from assistive technologies using display: none, visibility: hidden, or aria-hidden="true" on the link or its text content.
It’s also important to use semantic <a> elements with a valid href attribute rather than simulating links with <span> or <div> elements and click handlers. Real links are focusable by default and convey the correct role to assistive technologies.
Related WCAG Success Criteria
This rule relates to two Level A success criteria that apply across WCAG 2.0, 2.1, and 2.2:
- WCAG 2.4.4 (Link Purpose in Context): Users must be able to determine the purpose of each link from the link text alone, or from the link text combined with its programmatically determined context.
- WCAG 4.1.2 (Name, Role, Value): All user interface components, including links, must have an accessible name and role that can be programmatically determined.
This rule is also required under Section 508, EN 301 549, and Trusted Tester guidelines.
How to Fix It
-
Add visible text content inside the
<a>element. -
For image links, provide meaningful
alttext on the<img>element. -
Use
aria-labelwhen you need to provide an accessible name that differs from or supplements the visible text. -
Use
aria-labelledbyto reference another element’s text as the link’s accessible name. -
Don’t hide link text from screen readers with
aria-hidden="true"or CSS that removes elements from the accessibility tree. -
Ensure links are focusable by using proper
<a>elements withhrefattributes and avoiding mouse-only event handlers.
Examples
Empty link (incorrect)
A link with no text or accessible name:
<a href="/settings"></a>
A link that only contains an image with no alt text:
<a href="/home">
<img src="logo.png" alt="">
</a>
A link with its text hidden from assistive technologies:
<a href="/profile">
<span aria-hidden="true">Profile</span>
</a>
Link with visible text (correct)
<a href="/settings">Settings</a>
Image link with descriptive alt text (correct)
<a href="/home">
<img src="logo.png" alt="Homepage">
</a>
Link with aria-label (correct)
This is useful when multiple links share the same visible text, such as repeated “Read more” links:
<h3>Accessibility Updates</h3>
<p>New WCAG 2.2 guidelines have been published.
<a href="/wcag22" aria-label="Read more about WCAG 2.2 updates">Read more</a>
</p>
<h3>Screen Reader Tips</h3>
<p>Learn how to navigate tables with a screen reader.
<a href="/sr-tips" aria-label="Read more about screen reader tips">Read more</a>
</p>
Link with aria-labelledby (correct)
<h3 id="report-title">Annual Report 2024</h3>
<a href="/report-2024.pdf" aria-labelledby="report-title">Download PDF</a>
Icon link with visually hidden text (correct)
For links that use icons without visible text, use a visually hidden <span> to provide an accessible name:
<a href="/search">
<svg aria-hidden="true" focusable="false">
<use href="#icon-search"></use>
</svg>
<span class="visually-hidden">Search</span>
</a>
The visually-hidden class hides the text visually but keeps it available to screen readers:
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
The <object> element embeds external content into a web page — this could be a video, an audio player, an interactive applet, a PDF, or even another HTML page. Unlike images, which have a straightforward alt attribute, <object> elements rely on other mechanisms to provide text alternatives. When no alternative text is present, screen readers encounter the embedded object but have nothing meaningful to announce, leaving blind and deafblind users unable to understand what the content is or what purpose it serves.
Why this matters
Screen readers cannot interpret non-text content on their own. They depend entirely on text alternatives provided in the markup. When an <object> element lacks alternative text, users of assistive technology are left with no information about the embedded content. This is a serious barrier that can cause users to miss critical functionality or information on a page.
This rule relates to WCAG 2.0/2.1/2.2 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 an equivalent purpose. It is also required by Section 508 and EN 301 549.
How to fix it
Add alternative text to every <object> element using one of these approaches:
-
titleattribute — Add atitleattribute directly on the<object>element with a concise description. -
aria-labelattribute — Provide an accessible name usingaria-label. -
aria-labelledbyattribute — Reference theidof another element that contains the descriptive text. -
role="presentation"orrole="none"— If the embedded object is purely decorative and conveys no information, you can remove it from the accessibility tree entirely.
Writing effective alternative text
When crafting alternative text, consider these questions:
- Why is this embedded content on the page?
- What information does it present to sighted users?
- What purpose or function does it serve?
- If you removed the object, what words would you use to convey the same information?
Keep the text concise and meaningful. Avoid generic terms like “object,” “video,” or file names — instead, describe the content’s actual purpose. For example, “Quarterly revenue chart for 2024” is far more useful than “chart.swf.”
Examples
Incorrect: no alternative text
The <object> element has no accessible name, so screen readers cannot describe it.
<object data="quarterly-report.pdf"></object>
Incorrect: inner content used as fallback text
Text placed inside the <object> element is intended as fallback content for browsers that cannot render the object — it is not reliably exposed as an accessible name by screen readers.
<object data="quarterly-report.pdf">
This object shows the quarterly report.
</object>
Incorrect: only whitespace inside the element
<object data="quarterly-report.pdf">
<div> </div>
</object>
Correct: using title
<object data="quarterly-report.pdf" title="2024 Q3 quarterly revenue report"></object>
Correct: using aria-label
<object data="quarterly-report.pdf" aria-label="2024 Q3 quarterly revenue report"></object>
Correct: using aria-labelledby
<h2 id="report-heading">2024 Q3 Quarterly Revenue Report</h2>
<object data="quarterly-report.pdf" aria-labelledby="report-heading"></object>
Correct: decorative object with role="none"
If the embedded object is purely decorative and adds no informational value, remove it from the accessibility tree:
<object data="decorative-animation.swf" role="none"></object>
When you apply role="img" to an element, you’re telling assistive technologies to treat that element as a single image. This is commonly used to group decorative SVG elements, icon fonts, CSS background images, or multiple visual elements into one cohesive image. However, applying the role alone isn’t enough — assistive technologies also need a text alternative that describes the image’s content or purpose.
Without an accessible name, screen readers will either skip the element entirely or announce it as an unlabeled image, leaving users who rely on assistive technology without critical information. This affects screen reader users (who hear content read aloud), braille display users (who read content through tactile output), and to some extent users with low vision who may use screen readers alongside magnification.
This rule relates to WCAG 2.1 Success Criterion 1.1.1 (Non-text Content), which requires that all non-text content presented to the user has a text alternative that serves the equivalent purpose. It is a Level A requirement — the most fundamental level of accessibility compliance.
How to Fix It
Add an accessible name to any element with role="img" using one of these methods:
-
aria-label: Provide the text alternative directly as an attribute value. -
aria-labelledby: Reference theidof another element that contains the descriptive text. -
title: Use thetitleattribute as a fallback (thougharia-labelandaria-labelledbyare preferred, astitlehas inconsistent support across assistive technologies).
The text alternative should be concise and describe the content or purpose of the image. If the image is purely decorative and conveys no information, use aria-hidden="true" instead of role="img" to hide it from assistive technologies entirely.
Examples
Incorrect: role="img" with No Text Alternative
<div role="img">
<!-- SVG icon with no accessible name -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M12 2L2 22h20L12 2z"/>
</svg>
</div>
A screen reader encounters this as an image but has no name to announce, so the user gets no useful information.
Correct: Using aria-label
<div role="img" aria-label="Warning: hazardous area ahead">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M12 2L2 22h20L12 2z"/>
</svg>
</div>
Correct: Using aria-labelledby
<span id="chart-desc">Quarterly revenue growth from Q1 to Q4 2024</span>
<div role="img" aria-labelledby="chart-desc">
<!-- Complex chart composed of multiple elements -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100">
<rect x="10" y="60" width="30" height="40" fill="#4a90d9"/>
<rect x="50" y="40" width="30" height="60" fill="#4a90d9"/>
<rect x="90" y="25" width="30" height="75" fill="#4a90d9"/>
<rect x="130" y="10" width="30" height="90" fill="#4a90d9"/>
</svg>
</div>
Correct: Using title
<div role="img" title="Company logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<circle cx="25" cy="25" r="20" fill="#333"/>
</svg>
</div>
Correct: Decorative Image Hidden from Assistive Technology
If the image is purely decorative and adds no meaningful information, hide it instead of labeling it:
<div aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10">
<line x1="0" y1="5" x2="100" y2="5" stroke="#ccc" stroke-width="1"/>
</svg>
</div>
Note that role="img" is removed here because the element is not intended to be perceived as an image at all.
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.
When a data table needs a visible title, developers sometimes create a row at the top of the table containing a single cell that spans all columns using the colspan attribute. While this may look like a caption visually, it is semantically incorrect. Screen readers treat it as a regular data or header cell, not as a table title. This means users who rely on assistive technologies — particularly people who are blind or deafblind — won’t hear the table’s purpose announced as a caption. Instead, they’ll encounter what appears to be just another cell of data, making it harder to understand the table’s context and contents.
HTML provides the <caption> element specifically for this purpose. When a screen reader encounters a <table> with a <caption>, it announces the caption text as the table’s name. This gives users immediate context about what the table contains before they start navigating rows and columns. Without a proper <caption>, users must guess the purpose of the table from its data alone.
Related WCAG Success Criteria
This rule relates to WCAG 2.1 Success Criterion 1.3.1: Info and Relationships (Level A), which requires that information, structure, and relationships conveyed through presentation are programmatically determinable. A fake caption created with colspan conveys a relationship visually (this text is the title of this table) but fails to communicate that relationship programmatically.
It also applies to Section 508 guidelines requiring that row and column headers be identified for data tables, and that markup be used to properly associate data cells and header cells.
How to Fix It
-
Remove the fake caption row — delete the
<tr>containing the cell with acolspanattribute that serves as a visual caption. -
Add a
<caption>element — place a<caption>element as the first child of the<table>element, containing the table’s title text. -
Style as needed — if you need the caption to look a certain way, apply CSS to the
<caption>element rather than reverting to acolspan-based approach.
Examples
Incorrect: Using colspan to fake a caption
This approach creates a visual title but is not recognized as a caption by assistive technologies.
<table>
<tr>
<td colspan="4"><strong>Quarterly Sales Report</strong></td>
</tr>
<tr>
<th scope="col">Region</th>
<th scope="col">Q1</th>
<th scope="col">Q2</th>
<th scope="col">Q3</th>
</tr>
<tr>
<th scope="row">North</th>
<td>$12,000</td>
<td>$15,000</td>
<td>$13,500</td>
</tr>
</table>
Correct: Using the <caption> element
The <caption> element gives the table a programmatically associated name that screen readers announce automatically.
<table>
<caption>Quarterly Sales Report</caption>
<thead>
<tr>
<th scope="col">Region</th>
<th scope="col">Q1</th>
<th scope="col">Q2</th>
<th scope="col">Q3</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">North</th>
<td>$12,000</td>
<td>$15,000</td>
<td>$13,500</td>
</tr>
</tbody>
</table>
Correct: Styled <caption> element
If you need the caption to match a specific visual design, style it with CSS rather than using table cells.
<style>
table.data caption {
font-size: 1.2em;
font-weight: bold;
text-align: left;
padding: 8px 0;
}
</style>
<table class="data">
<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>
What This Rule Checks
The table-fake-caption rule inspects data tables for <td> or <th> cells that use a colspan attribute spanning all columns, which suggests the cell is being used as a visual caption. If such a pattern is detected and no proper <caption> element is present, the rule flags the table as a violation.
Data tables communicate structured information where each cell’s meaning depends on its position relative to row and column headers. When you look at a table visually, your eyes naturally track back to the headers to understand what a particular value represents. Screen readers replicate this behavior by announcing the relevant headers as users navigate between cells — but only when the headers are properly marked up in the HTML.
Without proper header associations, a screen reader might announce a cell value like “28:04” with no context. The user would have no way to know what that number represents, who it belongs to, or what category it falls under. This is a critical accessibility barrier for people who are blind or deafblind.
This rule relates to WCAG 2.1 Success Criterion 1.3.1 (Info and Relationships), which requires that information and relationships conveyed through visual presentation be programmatically determinable. It is also required by Section 508 guidelines, which mandate that row and column headers be identified for data tables and that markup be used to associate data cells with header cells for tables with two or more logical levels of headers.
The axe rule td-has-header checks tables that are at least 3 cells wide and 3 cells tall. If any non-empty <td> in such a table lacks an associated header, the rule fails.
How to Fix It
There are two primary techniques for associating data cells with headers:
Using <th> with scope
This is the simplest and preferred approach for straightforward tables. Replace header cells’ <td> elements with <th> elements and add a scope attribute:
-
Use
scope="col"for column headers. -
Use
scope="row"for row headers.
Screen readers use the scope attribute to determine which data cells belong to which header. This approach works well for tables where each column and row has a single header.
Using id and headers
For complex tables — such as those with merged cells, multiple header levels, or irregular structures — use the id and headers method. Give each <th> a unique id, then add a headers attribute to each <td> listing the id values of all headers that apply to that cell, separated by spaces.
This method is more verbose but allows you to explicitly define exactly which headers relate to each data cell, regardless of table complexity. Where possible, consider breaking a complex table into multiple simpler tables, which benefits all users.
Examples
Failing: Table with no headers
This table has no <th> elements at all, so screen readers cannot associate any data cell with a header.
<table>
<tr>
<td>Name</td>
<td>1 mile</td>
<td>5 km</td>
<td>10 km</td>
</tr>
<tr>
<td>Mary</td>
<td>8:32</td>
<td>28:04</td>
<td>1:01:16</td>
</tr>
<tr>
<td>Betsy</td>
<td>7:43</td>
<td>26:47</td>
<td>55:38</td>
</tr>
</table>
Passing: Simple table with scope
Column headers use scope="col" and row headers use scope="row", giving every <td> a clear association.
<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>
<tr>
<th scope="row">Matt</th>
<td>7:55</td>
<td>27:29</td>
<td>57:04</td>
</tr>
</tbody>
</table>
When a screen reader user navigates to the cell containing “26:47”, the screen reader announces something like “Betsy, 5 km, 26:47” — providing full context.
Passing: Complex table with id and headers
When a table has multiple levels of headers or merged cells, the id and headers method gives you explicit control over associations.
<table>
<caption>Race Results by Category</caption>
<thead>
<tr>
<td></td>
<th id="road" colspan="2">Road Races</th>
<th id="track" colspan="2">Track Events</th>
</tr>
<tr>
<td></td>
<th id="r5k">5 km</th>
<th id="r10k">10 km</th>
<th id="t800">800 m</th>
<th id="t1500">1500 m</th>
</tr>
</thead>
<tbody>
<tr>
<th id="mary">Mary</th>
<td headers="mary road r5k">28:04</td>
<td headers="mary road r10k">1:01:16</td>
<td headers="mary track t800">2:34</td>
<td headers="mary track t1500">5:51</td>
</tr>
<tr>
<th id="betsy">Betsy</th>
<td headers="betsy road r5k">26:47</td>
<td headers="betsy road r10k">55:38</td>
<td headers="betsy track t800">2:17</td>
<td headers="betsy track t1500">5:09</td>
</tr>
</tbody>
</table>
In this example, when a screen reader lands on “26:47”, it can announce “Betsy, Road Races, 5 km, 26:47” because the headers attribute explicitly lists all three relevant header id values.
Key points to remember
-
Always use
<th>for header cells, not styled<td>elements. -
Add a
<caption>to give your table a descriptive name. -
Use
scopefor simple tables andid+headersfor complex ones. -
Empty
<td>cells are excluded from this rule — only non-empty data cells need header associations. - Visual styling (borders, fonts, backgrounds) should be handled with CSS and has no impact on accessibility markup.
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.