Search topics
Decorative images read out as file names or repeated text
A workshop page has leaf dividers with no alt, so their file names are read, and card photos whose alt repeats the link text, so each title is read twice.
alt="Glazing mugs" The problem
Screen reader users hear a file name under the heading and every workshop title twice
A pottery shop has a page listing its workshops. Under the "Workshops" heading sits a thin line with a leaf in the middle, a small ornament from the theme. Below it, each workshop is a card: a photo of mugs on a shelf, then the title "Glazing mugs" and the date. The whole card is one link. A screen reader reads "Workshops, heading", then "divider-leaf.png, image", then "link, Glazing mugs, image, Glazing mugs". Every card on the page is read the same way, its title twice.
1.1.1 Non-text Content asks for decoration to be implemented so that assistive technology can ignore it. The divider is an <img> with no alt attribute at all. A missing alt doesn't mean "skip me": some screen readers fall back to the file name. The card photo has alt="Glazing mugs", the same words as the link text beside it, so the link's name says the title twice. None of these images tells anything the text doesn't, but none of them is implemented to be ignored.
The noise grows with the page. A list of twelve workshops means twelve repeated titles, on top of a file name at every section break.
1 of 10 groups affected
- No vision (affected)
- Low vision (not affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (not affected)
- Reach, strength (not affected)
- Cognitive (not affected)
- Seizures (not affected)
- Without vision Screen reader users hear "divider-leaf.png, image" between headings, and every workshop title twice, so each pass through the list takes longer and sounds broken.
axe's image-alt flags the divider because it has no alt. It can't tell whether an image is decoration: alt="Glazing mugs" passes because it isn't empty, and alt="divider" or alt="decorative leaf" pass too, although each reads a useless word. A quick AI fix may write a description for every image ("A thin brown line with a leaf"), which turns noise into more noise, or "fix" the repeated alt by deleting the attribute, which brings back the file name it was meant to silence. Deciding that an image adds nothing needs a person who can see it next to its text.
What the checkers report
- axe DevTools
- Images must have alternative text
- Alternative text of images should not be repeated as text
- Lighthouse
- Image elements do not have
[alt]attributes - Image elements have
[alt]attributes that are redundant text.
- Image elements do not have
- WAVE
- Missing alternative text
- Redundant alternative text
- Spacer image missing alternative text
- A nearby image has the same alternative text
Try it
Compare what a screen reader reads from the top of the workshop page, before and after the fix
The panel under the page shows what is read from the top. Listen for the divider, and count how often the card’s title is said.
Broken Can you fix this?
Reading from the top, a screen reader says:
- Workshops, heading
- divider-leaf.png, image
- link, Glazing mugs, image, Glazing mugs, Saturday 14 November, 10:00
The fix
Keep images that add nothing silent
<h2>Workshops</h2><img src="/images/divider-leaf.png" class="divider"> <a class="card" href="/workshops/glazing"> <img src="/images/glazing.jpg" alt="Glazing mugs"> <h3>Glazing mugs</h3> <p>Saturday 14 November, 10:00</p></a>What is wrong2 points
- Under the heading, a screen reader reads out the file name "divider-leaf.png". The divider has no
alt. - Each card's title is read twice. The photo's alt repeats the heading inside the same link, so the link's name says the title twice.
An empty alt on every image that adds nothing
<h2>Workshops</h2><img src="/images/divider-leaf.png" class="divider" alt=""> <a class="card" href="/workshops/glazing"> <img src="/images/glazing.jpg" alt=""> <h3>Glazing mugs</h3> <p>Saturday 14 November, 10:00</p></a>How it is fixed2 steps
- Give the divider
alt="". An empty alt is HTML's own way to say an image is decoration: screen readers skip it, and the browser shows nothing if it fails to load. - Give the card photo
alt=""too. The link is now read once, "link, Glazing mugs, Saturday 14 November, 10:00".
This fixes the Before and passes 1.1.1. The photo's alt is empty because this photo shows nothing the card's text doesn't; a photo that does gets alt text for that part, as described under Implementation decisions.
Why this fix: Use native HTML first
Both options leave the ornaments silent and the cards read once. An empty alt is the one to start with, because it is a single attribute that works for every kind of image, from a theme divider to a photo picked in the CMS, and it is the method HTML defines for decoration. Drawing ornaments with CSS costs a stylesheet change and suits only images fixed in the theme, but it also means nobody can put the divider back without an alt. A CSS background has no text alternative at all, which is fine for an ornament but a reason never to use CSS for anything that carries meaning (failure F3).
Images next to text: case by case. An image is decoration only where removing it would lose nothing a reader needs, so the same picture can be silent in one place and need alt text in another. The alt never repeats the text beside it; what changes is whether the image adds anything of its own. These are the common cases.
- A mood or stock photo on a card whose title and link say everything, like the mugs on the "Glazing mugs" card:
alt="". - An image and its text inside the same link to the same place: one link, with the image
alt=""and the text as its name (WCAG technique H2). - A product photo that shows what the text doesn't, such as a colour, a pattern or the item's condition: alt text that says only that ("Cream glaze with a brown rim"), not the product name again.
- An icon beside a label that says the same thing, such as a dishwasher icon next to "Dishwasher safe":
alt="". - An image that is the only content of a link or button: never empty; its alt is the name of the link or button.
- A chart, map or diagram beside text that summarises only part of it: informative, so it needs a text alternative (see the guide on informative images).
When in doubt, read the card aloud without the image and ask whether anything is missing.
An empty alt, not a missing one. alt="" and no alt mean opposite things. alt=" ", alt="divider", alt="spacer" and alt="decorative" are not fixes: each is read aloud.
aria-hidden and role="presentation". Both hide an image from screen readers too, and they are useful for inline SVG, which has no alt. On an <img>, alt="" does the same job without ARIA, and an image with aria-hidden but no alt still shows a broken-image icon when it fails to load.
Images that are the whole link. If a link holds only an image, the image can't be silent: its alt is the link's name. Give it the destination ("Glazing mugs workshop"), or add visible text and then make the image silent.
Focus. A silent image never takes focus. If a script, such as a zoom or lightbox effect, adds a tabindex to one, remove it; an image that needs to do something goes inside a real button with a name.
How Section 508 testing checks it. The Trusted Tester test for decorative images (7.B) passes an image only when all three of these hold.
- it is not the only means of conveying important information on the page;
- it is not in the tab order;
- its accessible name is empty, not missing.
The divider fails the third. The test does not apply to images with a non-empty name, so a photo whose alt repeats its title is judged under the test for meaningful images (7.A) instead; fix it for the reasons above all the same. Background images are outside 7.B too, and are tested separately.
CMS and component libraries. Give image fields a "decorative" checkbox that outputs alt="", rather than leaving the field empty and letting the theme fall back to the file name. Card components that take both a title and an image should never copy the title into the image's alt; let the editor describe what the photo adds, or mark it decorative.
Verify the fix
3 checks, no mouse.
Test with: Screen reader
Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat whenever the theme, the card component or the image fields change.
Limits
This is a starting pattern, not a guarantee for every application. Paths and class names in the snippets are placeholders. Whether an image is decoration depends on the page around it, so only a person who knows both can decide; keep that decision in your publishing review. Test the complete journey with your target assistive technology.
This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.
References
- WCAG Understanding: non-text-content (opens in a new tab)
- WAI Tutorial: images/decorative (opens in a new tab)
- WCAG Technique H67 (opens in a new tab)
- WCAG Technique H2 (opens in a new tab)
- WCAG Technique C9 (opens in a new tab)
- WCAG Technique F38 (opens in a new tab)
- WCAG Technique F39 (opens in a new tab)
- developer.mozilla.org: img (opens in a new tab)
EaseWeb service
Fixed it? Keep it from coming back.
I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.