How to fix: images made with role="img" without text
WCAG 2.2 success criterion 1.1.1 (level A)
Why it matters
Icons and CSS images marked role="img" are announced without meaning.
How to fix
Add aria-label, or aria-hidden="true" if decorative.
<span role="img" aria-label="Rated 4 of 5">★★★★☆</span>
Test it yourself
- Inspect elements with role="img" (often SVG icons, star ratings or CSS background images): each needs aria-label or aria-labelledby.
Common mistakes
- A star rating drawn with icons and role="img" but no label like "4 of 5 stars".
- Adding role="img" to a decorative icon instead of aria-hidden="true".
Check your own site
Find this and other problems on your website in 30 seconds, free.