Skip to content
easeweb
Search topics

Low-contrast text over photos and hero images

White words are laid straight on a photo or a slideshow image, or on a panel too thin to matter, so they fade wherever the picture turns bright.

WCAG 2.2
SC 1.4.3AA
Required by
Section 508 · EN 301 549 (EU)
Broken .slide-text { color: #fff; }
The accessibility problem illustrated: Low vision:What does it say?
01

The problem

People with low vision can't read the headline over a hero photo or a slide, wherever the photo behind it is bright

02

Try it

Read the headline and the line under it, then do the same on every slide

  • Broken 1: the white words sit straight on the photo. Use Next slide to go through all three: can you read every word on each one?

  • Broken 2: the words sit on a see-through dark panel. Is it dark enough where the photo behind it is brightest?

  • Apply a fix. Go through the slides again: can you read every word on each one now?

Broken Can you fix this?

Linen for the table

Napkins, runners and tea towels, washed soft.

Shop table linen
1 of 3

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give text over a photo a backing that holds on any photo

Before

White words straight on the photo

<div class="slide">  <img src="/images/linen-napkins.jpg" alt="">  <div class="slide-text">    <h2>Linen for the table</h2>    <p>Napkins, runners and tea towels, washed soft.</p>    <a href="/linen">Shop table linen</a>  </div></div>
What is wrong4 points
  • The white words have nothing behind them but the photo.
  • Behind the headline the window reaches #fcfbfc: 1.03:1, where the 32px bold headline needs 3:1.
  • The line under it is 1.03:1 too, where 17px text needs 4.5:1.
  • The other two slides are as bright, and the words don't change to match them.
After

A panel behind the words

<div class="slide">  <img src="/images/linen-napkins.jpg" alt="">  <div class="slide-text">    <h2>Linen for the table</h2>    <p>Napkins, runners and tea towels, washed soft.</p>    <a href="/linen">Shop table linen</a>  </div></div>
How it is fixed2 steps
  1. Give the words a panel of 60% black. Over the brightest a photo can be, pure white, the panel is #666666, and white text on it is 5.74:1, so both the headline and the line under it pass on any photo.
  2. Pad the panel, so the words never touch its edge where the photo shows through.

This fixes both Befores and passes 1.4.3 on every slide, whatever photo an editor puts in. The rest of each photo stays as bright as it was.

04

Design ideas

Words on a photo can stay light and calm, and still be read

Five more ways to set a slide’s words over the shop’s photos. Point at each one and Tab to it: three keep their ratio over any photo, and two lose it where the photo is bright.

In the design file

  • Draw every slide and banner over the brightest photo it might get, not only the one in the mock-up.
  • Write the backing beside the words, with how see-through it is and its ratio over pure white. Normal text needs 4.5:1 and large text 3:1; 60% black gives 5.74:1, and 30% black only 2.10:1.
  • Draw the phone width too, with the headline wrapped onto every line it takes, still on its backing.
  • Leave a text shadow out of the count, and give the ratio of the words against the photo without it.

Passes

Fails

  • White words with a soft shadowWCAG 1.4.3 The shadow darkens only a blur around each letter. Behind the headline the window still reaches #efefef, where white is 1.15:1 and the headline needs 3:1.
  • An outlined button on the photoWCAG 1.4.3 A white outline and a white label with nothing filled in between, so the label sits straight on the photo. Over the pale floor it is 1.40:1, where a 15px label needs 4.5:1.
05

Verify the fix

3 checks, no mouse.

Test with: Contrast measurement, Zoom, Forced colors

0 of 3 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the photos, the slideshow's layout or the theme change.

Limits

This is a starting pattern, not a guarantee for every application. The colour values are examples; measure your own backings over your real photos. Text that is part of the photo itself, such as a street sign, is incidental and not covered by 1.4.3; words drawn into an image file are covered in images of text instead of real HTML text. Text in a brand colour, and text that fades on hover, are in low-contrast text in brand colours and hover states, and the 7:1 of Level AAA in grey body text under 7:1 contrast. A contrast ratio is a minimum, not proof that text is comfortable to read over a photo: check the complete pages with people who rely on it.

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