Elements must meet minimum color contrast ratio thresholds

How to fix the color-contrast accessibility rule. Colour and contrast.

What this rule checks

Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds

Who is affected

Text without enough contrast against its background is hard or impossible to read for people with low vision, colour blindness, or anyone on a phone in sunlight.

How to fix it

Darken the text (or lighten the background) until the ratio reaches 4.5:1 for normal text or 3:1 for large text. The suggested colour below is the closest one that passes.

Try colours in the contrast checker: it shows the ratio and suggests the closest colour that passes.

WCAG success criteria

When this rule fails, the page fails:

Find it on your own page

Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.

More detail