Skip to content
easeweb
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.

WCAG 2.2
SC 1.1.1A
Required by
Section 508 · EN 301 549 (EU)
Broken alt="Glazing mugs"
The accessibility problem illustrated: No vision:Divider-leaf.png?
01

The problem

Screen reader users hear a file name under the heading and every workshop title twice

02

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?

BrokenOrnaments with no alt and a photo that repeats its link

Reading from the top, a screen reader says:

  1. Workshops, heading
  2. divider-leaf.png, image
  3. link, Glazing mugs, image, Glazing mugs, Saturday 14 November, 10:00

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Keep images that add nothing silent

Before
BrokenOrnaments with no alt and a photo that repeats its link
<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.
After

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
  1. 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.
  2. 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

Easily confused
04

Verify the fix

3 checks, no mouse.

Test with: Screen reader

0 of 3 checked

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.

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.

See the service