Accessibility

a11y/img-alt

Every img and area element has an alt attribute; a decorative image has alt="".

criticalstaticWCAG 1.1.1 · Afe-html

Why

Without alt, a screen reader announces the file name or nothing, and the image's meaning is lost; when the image fails to load, nothing replaces it.

Fix

Describe what the image says in this context (alt="Revenue grew 20% in 2026"), not what it looks like. For an image that only decorates, write alt="" so assistive technology skips it. An image inside a link that has no other text needs the link's purpose as its alt.

Examples

<!-- bad -->
<img src="chart.png">
<!-- good -->
<img src="chart.png" alt="Revenue grew 20% in 2026">
<img src="divider.svg" alt="">

Sources

Facts

Id
a11y/img-alt
Severity
critical
Check
static checked in the source by audit
Applies to
html angular vue svelte astro jsx
WCAG 2.2
1.1.1, level A
Same problem in
axe-core image-alt, axe-core area-alt
Taught by the skill
fe-html HTML documents and semantics
Since version
0.1.0

Rule file on GitHub

Read it in the terminal

npx github:dawidolko/frontend-skills explain a11y/img-alt