Skip to content
WANCODE
BM

Fix the Contrast

12 minBeginnerAccessibility

This event card is pretty — and hard to read. Pale grey text, a light-blue link, white text on yellow and mint-on-mint are all too faint for many people: anyone with low vision, older eyes, or a phone in bright sunlight.

WCAG AA asks for a contrast ratio of at least 4.5:1 for normal text. The ratio compares the brightness (relative luminance) of the text and its background: 1:1 is invisible, 21:1 is black on white.

Requirements

  • .details, .more, .btn and .badge each reach ≥ 4.5:1.
  • Keep the design recognisable: you may change text colours, background colours or both. Don't hide anything.
  • The checker computes the real ratio from the computed colours (including transparency), so any valid CSS colour format works. Background images aren't used here.

Change the colours in style.css so the details text, the link, the button and the badge all reach a contrast ratio of at least 4.5:1 against their backgrounds (WCAG AA).

Checks

  • Details text ≥ 4.5:1
  • Link ≥ 4.5:1
  • Button text ≥ 4.5:1
  • Badge ≥ 4.5:1
Preview

Console output from your code appears here.

Step 1 of 1