Skip to content
easeweb
Search topics

Banner and image links with no name

A promo banner link holds only a decorative photo, or is an empty link laid over the banner, so it has no name and a screen reader says only "link".

WCAG 2.2
SC 2.4.4A
Required by
Section 508 · EN 301 549 (EU)
Broken <a href="/collections/autumn-roasts" class="banner-link"><img src="/images/autumn-roasts.jpg" alt=""></a>
The accessibility problem illustrated: No vision:Where does this link go?
01

The problem

Screen reader users reach a banner link that says nothing, so they can't tell where it goes before they follow it

02

Try it

Press Tab to reach the banner’s link, then try the simulated voice control

  • Broken 1: Tab to the banner’s link, then say the words on its pill. The panel shows what a screen reader announces for the link, and its list of links. Does the banner’s link say where it goes, and does saying the words on its pill reach it?

  • Broken 2: the photo sits outside the link here, and the link is an empty box laid over the banner. Try the same: does the link say where it goes, and does saying the words on its pill reach it?

  • Apply a fix. Try Tab and the voice control again: does the link now say where it goes, and does saying the words on its pill reach it?

Broken Can you fix this?

Autumn roasts are here

Three new single-origin beans, roasted this week.

Shop the roasts
Voice control (simulated):

Screen reader says:

Its list of links:

  1. (no name) collections/autumn-roasts

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give the banner's link the words on its pill

Before

The photo as the link, marked as decoration

<div class="banner">  <a href="/collections/autumn-roasts" class="banner-link">    <img src="/images/autumn-roasts.jpg" alt="">  </a>  <div class="banner-text">    <h2>Autumn roasts are here</h2>    <p>Three new single-origin beans, roasted this week.</p>    <span class="banner-cta">Shop the roasts<span aria-hidden="true"> →</span></span>  </div></div>
What is wrong2 points
  • A screen reader says only "link" or the address. The link's only content is an image with alt="", so it has no name, and it fails 2.4.4.
  • Saying "click Shop the roasts" reaches nothing. The pill that says where the link goes is a drawing over the link, not part of it, so its words are not the link's name.
After

Add the pill's words to the link you have

<div class="banner">  <a href="/collections/autumn-roasts" class="banner-link">    <img src="/images/autumn-roasts.jpg" alt="">    <span class="visually-hidden">Shop the roasts</span>  </a>  <div class="banner-text">    <h2>Autumn roasts are here</h2>    <p>Three new single-origin beans, roasted this week.</p>    <span class="banner-cta">Shop the roasts<span aria-hidden="true"> →</span></span>  </div></div>
How it is fixed2 steps
  1. Put the pill's words, "Shop the roasts", in a span inside the banner link. The link is now announced as "Shop the roasts, link", and voice control finds it when someone says the words on the pill.
  2. Hide the span from view with a visually-hidden class, so adding the words leaves the layout as it is.

This fixes both Befores and passes 2.4.4. On a banner built the second way, the same span goes in the empty link laid over it, and nothing else changes. The name uses the pill's words rather than the headline's because the pill is what reads as the thing to press: WCAG 2.5.3 Label in Name asks that a control's name contains the words that label it on screen, so people can say what they see.

When the photo is the link's only content, its alt can carry the words instead, alt="Shop the roasts", as technique H30 describes: the alt then names where the link goes, not what the photo shows. Instead of hidden text, the link can also take its name from the pill with aria-labelledby, pointing at an id on the pill, or at the pill and then the headline (technique ARIA7), so the words can't drift apart. Either way, someone reading the banner from top to bottom hears the pill's words twice: once as the link and once as text.

Easily confused
04

Verify the fix

5 checks.

Test with: Keyboard, Screen reader, Speech input, Mouse

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared banner or slideshow component changes.

Limits

This is a starting pattern, not a guarantee for every application. Paths and class names in the snippets are placeholders. Content editors can still leave a banner's pill text empty later, so keep link names 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