Bagian ini masih dalam bahasa Inggris untuk sementara.
TL;DR
An inline <svg> that carries meaning needs role="img" plus a name from <title> or aria-label. A purely decorative one should be hidden with aria-hidden="true".
This check flags an inline <svg> that conveys meaning but exposes no accessible text, so a screen reader either skips it or dumps raw path data. That means the padlock next to your secure-checkout copy, or the chart summarizing your pricing, simply does not exist for a blind user. Because inline SVG icons often carry the only label on a control, a nameless one can also strip the accessible name off a button or link, which is where the accessibility gap starts costing you conversions.
Why Inline SVG Is Its Own Problem
A raster image loaded through <img> has one obvious slot for alternative text, the alt attribute, and everyone knows to fill it. Inline SVG has no alt. It is a live chunk of the DOM made of shapes, and how a screen reader treats it depends on the role and attributes you give the root element. Left alone, an inline SVG is ambiguous: some assistive tech ignores it, some announces it as a graphic with no name, and some has historically read out the text nodes buried in the markup, which can be nonsense. The result is that a meaningful icon, the thing telling a user a field is required, a message is an error, or a link opens in a new window, silently vanishes. The flip side is just as common and just as damaging: decorative flourishes that were never meant to be announced end up cluttering the audio experience because nobody told the screen reader to skip them. Getting this right is a two-part decision, and the first part is honest triage of which SVGs actually carry meaning.
A Real Failure, and the Fix
A "download" icon button ships the graphic but no text at all, so it announces as an empty button:
Now the button announces "Download report, button." If the icon is purely decorative, do the opposite and mark it aria-hidden="true" with a focusable="false" so assistive tech ignores it cleanly.
Meaningful vs Decorative: Pick a Lane
SVG Plays This Role
Example
What to Add
Standalone meaning
A chart, a logo, a status icon
role="img" + <title> or aria-label
Only label on a control
Icon-only button or link
Name the control (icon named or button labeled)
Redundant with adjacent text
Cart icon beside the word "Cart"
aria-hidden="true" + focusable="false"
Pure decoration
Background flourish, divider
aria-hidden="true"
How to Detect It
axe DevTools: run the scan and look for "SVG elements with an img role must have an alternative text," which lists each graphic missing a name.
Lighthouse: run the Accessibility audit; unnamed image-role SVGs surface under the ARIA and image-alternative-text results.
WAVE: load WAVE and check for missing alternative-text alerts on inline graphics and icon controls.
Manual check: tab to icon-only buttons and links with a screen reader; if one announces as "button" with no name, its SVG is the missing text.
How to Fix It
First decide whether the SVG means anything on its own. If it does, add role="img" and give it a name, either a <title> referenced by aria-labelledby or a direct aria-label, and keep that text short and descriptive of purpose, not shape. If the graphic is decorative or duplicates nearby text, hide it with aria-hidden="true" and set focusable="false" so older browsers do not place it in the tab order. When the SVG is the sole content of a button or link, naming the control is often cleaner than naming the icon. The same alternative-text logic covers role=img elements need alternative text and icon-only controls in links must have discernible text.
Frequently Asked Questions
Is a <title> Alone Enough?
A <title> helps, but support has historically been uneven, so pair it with role="img" and reference it via aria-labelledby, or use aria-label instead. That combination is announced reliably across screen readers.
What About an SVG Loaded Through an <img> Tag?
When an SVG is referenced with <img src="icon.svg">, it follows normal image rules; give it an accurate alt attribute. This check is specifically about inline <svg> markup in the DOM.
Should Decorative Icons Get Empty Alt Text?
For inline SVG there is no alt attribute, so hide decoration with aria-hidden="true". Empty alt="" is the equivalent technique only for raster images loaded via <img>.
Why Add focusable="false"?
Some legacy browsers place inline SVGs in the tab order by default. Setting focusable="false" keeps a decorative or already-labeled graphic from stealing a stop, which keeps keyboard navigation tidy.
How Long Should the SVG Name Be?
Long enough to convey purpose, short enough to say quickly. Name the function, "Download report," "Verified account," not the drawing, and skip words like "icon" or "image" since the role already tells the user it is a graphic. For a complex graphic such as a chart, name it briefly and put the full detail in adjacent body text linked with aria-describedby.
Need a full technical audit?
Neova runs deep crawls that catch issues like this across your whole site.
Temukan Ini di Situs Anda Sendiri
Neova menjalankan pemeriksaan ini dan semua pemeriksaan lain di setiap crawl, lalu menuliskan perbaikannya sebagai tiket untuk tim Anda.
Aplikasi desktop untuk Mac, Windows, dan Linux
Semua 696 pemeriksaan, masing-masing dengan sumbernya
Search Console dan Analytics 4, terhubung hanya-baca
Tiket ke Jira, Linear dan Asana
Unduh NeovaPaket Desktop Free, atau Solo gratis selama 14 hari, tanpa kartu.