Barrierepruefung.de Web Accessibility Checker

Insufficient colour contrast

The finding means the contrast between the text colour and the colour behind it is below 4.5:1, or below 3:1 for large text. Typical culprits are light grey text, white lettering on bright brand colours and semi-transparent text. Fix it with a darker text or background colour, defined once in a central place.

Last reviewed: Sources

The message

Identifier
color-contrast
Type of check
automatic
Severity
serious
Success criterion
Meaning
The ratio between text and background colour falls below the required minimum.
Impact
People with impaired vision, or anyone in poor lighting, cannot read the text.
Fix
Raise the contrast to at least 4.5:1, or 3:1 for large text.

How does your website stand?

The free check shows what can be measured automatically, with the location. No account.

Check website for free

What the rule checks

For every visible piece of text, axe works out the text colour and the colour that actually sits behind it, then calculates the contrast ratio. Transparent backgrounds and the opacity of parent elements are blended in. Large text is recognised by size and weight: 18 points, or 14 points when bold.

Sometimes the background cannot be determined: there is an image or a gradient behind the text, another element covers it, or the text is part of an image. axe then makes no decision, and the spot appears in the report as an uncertain result with a screenshot for a person to judge, not as a defect.

Common causes

  • Light grey as a style. Secondary text, dates, captions and footers in #999999 on white reach 2.85:1.
  • White lettering on bright brand colours. Buttons and banners in orange, yellow or light blue: white on #f59e0b only reaches 2.15:1.
  • Transparency. Text with opacity: 0.6, or a colour with an alpha channel, looks lighter than its colour value suggests, and axe measures what is rendered.
  • Sections nobody restyled. A link or button keeps its colour when it is placed in a section with a dark or coloured background.
  • Text that only looks disabled. Genuinely disabled controls are exempt. A button styled to look faint that still works is not.

How to fix it

Define colours once rather than fixing element after element. With custom properties, a single change covers the whole site:

:root {
  --text-muted: #767676;  /* 4.54:1 on white, previously #999999 at 2.85:1 */
  --brand-fill: #b45309;  /* white on it: 5.02:1, previously #f59e0b at 2.15:1 */
}

.meta,
.caption {
  color: var(--text-muted);
}

.button {
  color: #ffffff;
  background-color: var(--brand-fill);
}

Replace transparency on text with a solid colour that can be measured:

/* before */
.note { color: #000000; opacity: 0.5; }

/* after */
.note { color: #595959; } /* 7.0:1 on white */

Check the new colour on every background it appears on, not just on white. If the brand colour cannot deliver enough contrast, keep it for surfaces and borders and set the text on it in a dark colour instead of white.

For text over images axe cannot calculate a ratio, and the spot remains an uncertain result. It only becomes measurable with an opaque surface behind the lettering:

.hero h2 {
  color: #ffffff;
  background-color: #1a1a1a; /* 17.4:1 */
  padding: 0.25em 0.5em;
}

A semi-transparent surface lets the image show through. axe cannot measure that either, and for the manual decision the lightest part of the image behind the text is what counts.

What the criterion requires in detail, and what is exempt, is explained on the page about WCAG 1.4.3.