Book a call Free rebuild

Contrast

January 13, 2026 Updated November 16, 2026 4 min read

Design glossaryContrast is the difference between elements, such as light and dark, large and small, that makes them stand apart. Text needs enough color contrast to be readable (WCAG asks for 4.5:1 for body text).

Contrast is what makes one thing look different from what surrounds it. Designers create it with lightness, color, size, weight, shape, and space, and use it for two jobs: making content readable, and telling the reader what matters most. A page with no contrast is a gray wall; a page where everything contrasts with everything is just as hard to read.

On a website, contrast has a measurable side (is the text readable against its background?) and a judgment side (does the most important thing on the page stand out?). Both matter.

Types of contrast

  • Lightness: dark text on a light background, or light text on a dark one. This is the contrast that decides readability.
  • Color: different hues, such as an orange button on a blue page. Complementary colors give the strongest hue contrast, but hue alone does not make text readable.
  • Size and weight: large, bold headings against smaller, regular body text set up the reading order.
  • Shape: a rounded button among square cards, or an icon beside text, separates elements without relying on color.
  • Space: generous white space around one element isolates it and draws the eye.
  • Texture: a photo or pattern behind flat areas adds depth, though it makes overlaid text harder to read.

Contrast ratio and WCAG

The Web Content Accessibility Guidelines (WCAG) measure text contrast as a ratio between the relative luminance of the text and its background, from 1:1 (no difference) to 21:1 (black on white). The thresholds are:

WhatLevel AALevel AAA
Body text4.5:17:1
Large text (24 px regular, or about 18.7 px bold, and up)3:14.5:1
Interface parts and meaningful graphics (input borders, icons, focus rings)3:1No stricter level

Level AA is the usual target, and it is the level most accessibility laws and policies point to. WCAG also asks that color is never the only way information is conveyed, so a red error message needs an icon or text as well. A newer method called APCA is being explored for a future version of WCAG, but the ratios above are the current standard.

Contrast and visual hierarchy

Readers see the highest-contrast element on a page first. Good visual hierarchy spends that contrast on purpose: the headline, then the primary button, then supporting content. If the cookie banner, a sidebar ad, and the call to action all compete at full strength, nothing wins. Keeping one accent color for actions only, and using muted tones elsewhere, is a simple way to keep the order clear.

How to check contrast

  • Browser DevTools: in Chrome, the color picker in the Styles pane shows the contrast ratio of the selected text and whether it passes AA and AAA.
  • Lighthouse and PageSpeed Insights: the accessibility audit flags text with insufficient contrast.
  • Contrast checkers: tools such as the WebAIM Contrast Checker take two colors and report the ratio.
  • WordPress: the block editor warns in a block's color settings when a text and background combination may be hard to read.

Test text over images and gradients at their lightest and darkest points, and check hover, focus, and disabled states, not just the default one. For a broader checklist, see our guide to WordPress accessibility.

Common mistakes

  • Light gray body text on white because it "looks cleaner". It often fails 4.5:1.
  • White text on brand colors that are too light, such as yellow or light green buttons.
  • Placeholder text used as the only label in a form, usually set in pale gray.
  • Text over photos with no overlay, readable in one spot and lost in another.
  • Every element styled loudly, so nothing stands out.

FAQs

Why is contrast important in web design?

Contrast makes text readable and shows people where to look. Enough lightness contrast lets everyone, including people with low vision or a phone in bright sunlight, read the content, while contrast in size, color, and space sets the order in which visitors notice things.

What is a contrast ratio, and why does it matter?

A contrast ratio compares the relative luminance of text and its background, from 1:1 to 21:1. WCAG level AA asks for at least 4.5:1 for body text and 3:1 for large text and interface parts. Meeting those ratios is the measurable part of making a site accessible.

How does color contrast affect user experience?

Clear color contrast makes buttons, links, and headings easy to find and text easy to read. Weak contrast slows reading and hides key actions, and relying on color alone shuts out people with color blindness, so pair color with text, icons, or underlines.

What are shape contrast and size contrast in design?

Shape contrast uses different forms, such as a rounded button among square cards, to set an element apart. Size contrast makes the most important element, usually a headline or primary action, noticeably larger than the rest. Both create emphasis without depending on color.

Can texture contrast and space contrast improve design clarity?

Yes. Space is one of the strongest tools available: surrounding an element with white space isolates it and makes a page easier to scan. Texture, such as a photo or pattern, adds depth, but text placed over it needs an overlay or solid backing to stay readable.

Source: W3C, Understanding Success Criterion 1.4.3: Contrast (Minimum).

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.