Accessible Image Maps: Ensuring <area>
Elements Have Alternate Text
Rule ID: area-alt
Ruleset: axe-core 4.10
User Impact: Critical
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), Section 508, Trusted Tester, EN 301 549
How to Fix the Problem
To ensure image maps are accessible, each <area>
element within an image map must have a descriptive text alternative using one of the following attributes:
-
alt
-
aria-label
-
aria-labelledby
These attributes provide critical context to users relying on screen readers.
Example: Correct Use of <area>
Elements
Each <area>
is assigned a unique alt
value that describes the destination or purpose of the link.
What to Avoid
Do not use server-side image maps (i.e., <img ismap>
), as they:
-
Do not support keyboard navigation.
-
Fail to provide alternative text for the interactive regions.
-
Are generally inaccessible to assistive technologies.
Example of bad practice:
Why it Matters
Screen readers cannot interpret visual content. When an image map lacks alt text for its <area>
elements:
-
Screen readers may announce unhelpful information like the image filename.
-
Users who are blind or have low vision miss crucial navigational or contextual cues.
-
The interactive purpose of different hotspots is lost, making navigation confusing or impossible.
Proper alt text ensures that all users, regardless of ability, can understand and interact with the content.
Rule Description
An image map allows multiple interactive regions within a single image. For accessibility:
-
Each region (
<area>
) must have a descriptive alternative text. -
The image itself should also have an
alt
attribute describing the overall context.
This ensures assistive technologies can convey both the overall image meaning and the function of each hotspot.
The Algorithm (in Simple Terms)
-
Look for any
<img>
element with ausemap
attribute. -
Check if the referenced
<map>
contains<area>
elements. -
For each
<area>
:-
Ensure it includes a valid
alt
,aria-label
, oraria-labelledby
attribute. -
Ensure the text value is not empty.
-
If any <area>
lacks this descriptive labeling, the image map fails accessibility requirements.