<svg> elements with an img or image role must have alternative text
How to fix the svg-img-alt accessibility rule. Images and text alternatives.
What this rule checks
Ensure <svg> elements with an img, image, graphics-document or graphics-symbol role have accessible text
Who is affected
This SVG is announced as an image but has no name.
How to fix it
Add a <title> as the first child of the SVG, or an aria-label.
Example
Before
<svg role="img">…</svg>After
<svg role="img" aria-label="Company logo">…</svg>WCAG success criteria
When this rule fails, the page fails:
- 1.1.1 Non-text Content (Level A, WCAG 2.0, 2.1, 2.2)
Find it on your own page
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.
More detail
- Deque University’s reference for svg-img-alt (the makers of axe-core, the engine our scanner uses)
- All fix guides