How to Fix Low Text Contrast and Unlabeled Form Fields (WCAG)

This check flags pages where text does not meet the WCAG minimum contrast against its background, or where form fields (inputs, selects, textareas) have no accessible label. By the end you will have corrected your colour palette at the template level, labelled every form field, and confirmed the fix across the whole site rather than on a single page.

By Updated ⏱ 1-3 hours🎯 Intermediate● Medium impactTechnical
Illustration: Accessibility contrast (WCAG) fix guide
TECHNICAL · FIX GUIDE Accessibility contrast (WCAG) IMPACTEFFORT TIME1-3 hours LEVELIntermediate

Why it matters

Low-contrast text is hard to read for people with low vision, older users and anyone on a phone in sunlight, which increases bounce and lowers form completion. Unlabeled fields are announced as just "edit text" by screen readers, so blind users cannot complete signups or checkout. 2 AA exposes you to legal risk under the European Accessibility Act (enforced since June 2025) and the ADA.

Because the audit scores you by the share of affected pages, one bad template can fail hundreds of URLs at once.

✕BeforeFooter text in #9CA3AF on #FFFFFF(2.5:1) and a newsletter <inputtype="email" placeholder="Your email">✓AfterFooter text in #4B5563 on #FFFFFF(7.6:1) and <labelfor="nl-email">Email address</label>

What you need

Access to your theme, CSS or design system colour settings
Chrome DevTools with Lighthouse, or the axe DevTools / WAVE browser extension
WebAIM Contrast Checker (webaim.org/resources/contrastchecker)
A list of your page templates (home, blog post, product, contact, footer)

Step-by-step fix

1

Find the failing elements and group them by template

Open a few representative pages (home, a blog post, a product or service page, contact) in Chrome, press F12, open the Lighthouse tab, tick only Accessibility and run it. Note the items under "Background and foreground colors do not have a sufficient contrast ratio" and "Form elements do not have associated labels". Most failures repeat on every page because they live in the header, footer, cookie banner or newsletter block, so fix those shared components first.

Pro tip: axe DevTools lists the exact foreground/background hex values and current ratio for each failing node, which saves guessing which CSS rule applies.
2

Pick compliant colours for each text role

WCAG 2.2 AA requires:

  • 4.5:1 for normal text
  • 3:1 for large text (24px regular, or 18.66px / 14pt bold and up)
  • 3:1 for UI component boundaries and icons that convey meaning

Paste each colour pair into the WebAIM Contrast Checker and darken the text (or lighten the background) until it passes. On white, #767676 is the lightest grey that passes 4.5:1; common failures are #999999 (2.8:1) and #AAAAAA (2.3:1).

Pro tip: Keep the hue and only adjust lightness so the brand still looks the same; most brand blues and greens pass once darkened by 10-20%.
3

Update colours at the design-token or theme level

Change the colours where they are defined once (CSS custom properties, theme settings, Tailwind config) instead of overriding individual elements. Check every state: muted/secondary text, placeholder text, link hover and visited states, disabled-looking buttons that are actually clickable, and text on coloured buttons. Brand buttons with white text on light orange or yellow are a frequent failure.

html
<style>
:root {
  --text-body: #1F2937;   /* 14.7:1 on #FFF */
  --text-muted: #4B5563;  /* 7.6:1 on #FFF, was #9CA3AF (2.5:1) */
  --link: #1D4ED8;        /* 6.7:1 on #FFF */
  --btn-bg: #B45309;      /* white text = 5.0:1 */
}
body { color: var(--text-body); }
.meta, .footer small { color: var(--text-muted); }
a { color: var(--link); }
::placeholder { color: #6B7280; opacity: 1; } /* Firefox lowers opacity by default */
.btn-primary { background: var(--btn-bg); color: #FFFFFF; }
</style>
4

Fix text placed over images and gradients

Hero banners with white text over photos fail whenever the image has light areas. Add a semi-transparent dark overlay behind the text so the ratio holds against the lightest part of the image. Test the worst-case spot of the image, not the average.

html
<style>
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.hero__content { position: relative; color: #FFFFFF; }
</style>
Pro tip: Automated tools often report text on background images as "needs review"; check those manually with the eyedropper in the WebAIM checker.
5

Give every form field a programmatic label

Each input, select and textarea needs an accessible name. The most robust method is a visible <label> whose for attribute matches the field's id. A placeholder is not a label: it disappears on typing and many screen readers do not announce it reliably.

Check newsletter signups, search boxes, contact forms, quantity selectors and cookie-consent toggles.

html
<form action="/subscribe" method="post">
  <label for="nl-email">Email address</label>
  <input type="email" id="nl-email" name="email" autocomplete="email" required>

  <label for="topic">Topic</label>
  <select id="topic" name="topic">
    <option>Sales</option>
    <option>Support</option>
  </select>

  <button type="submit">Subscribe</button>
</form>
Pro tip: Make sure every id is unique on the page; duplicate ids (e.g. the same newsletter form in header and footer) break the label association.
6

Label compact fields without changing the design

Where the design has no room for a visible label (header search, single-field newsletter bar), use a visually hidden label or aria-label. Visually hidden labels are preferred because they also work with translation tools. Never use display:none or visibility:hidden on the label, as that removes it from the accessibility tree too.

html
<style>
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
</style>
<form role="search" action="/search">
  <label for="site-search" class="visually-hidden">Search Example Co</label>
  <input type="search" id="site-search" name="q" placeholder="Search">
  <button type="submit" aria-label="Submit search">
    <svg aria-hidden="true" focusable="false"><!-- icon --></svg>
  </button>
</form>
Pro tip: For third-party embeds (HubSpot, Mailchimp, Klaviyo) switch label display on in the form builder, then hide it visually with your own CSS if needed.
7

Retest across all templates and re-run the audit

Clear any page cache or CDN cache, then re-run Lighthouse or axe on one page per template, including pages with forms and popups (open them before testing). When those are clean, re-run the site audit: the score is based on how many pages still fail, so any remaining failures will point to a template you missed.

text
npx @axe-core/cli https://example.com https://example.com/blog/sample-post https://example.com/contact --tags wcag2aa
Pro tip: Add an axe or pa11y-ci run to your deploy pipeline so a future colour tweak cannot reintroduce the issue.

Platform-specific notes

WordPress

Block themes: Appearance > Editor > Styles > Colors to change palette tokens site-wide. Classic themes: Appearance > Customize > Colors, or Additional CSS. In WPForms and Gravity Forms do not set the field label to "Hide" without the screen-reader option; Contact Form 7 needs you to wrap each tag in <label> in the form template yourself.

Shopify

Change colours in Online Store > Themes > Customize > Theme settings > Colors (colour schemes in Online Store 2.0 themes). Check each scheme, since sections can use different ones. Dawn-based themes already use visually-hidden labels; custom newsletter or search snippets in sections/*.liquid often need a <label for> added manually.

Wix

Edit the palette in Site Design > Theme (or Colors in Wix Studio). For Wix Forms, open the form settings and keep the field title visible or set it as the accessibility label; placeholder-only fields fail. Run Settings > Accessibility Wizard to catch remaining issues.

Webflow

Update colour Variables in the Variables panel so every class referencing them changes at once. In Form Blocks, keep the Field Label element and set its For attribute in Element Settings to match the input's ID; if you hide it, use a visually-hidden combo class rather than Display: None.

Next.js / React

Fix colours in your tokens file or tailwind.config (e.g. replace text-gray-400 with text-gray-600 on white). In JSX use htmlFor, not for. Add eslint-plugin-jsx-a11y (label-has-associated-control rule) and @axe-core/react in development to catch new issues.

Check that it worked

✅ How to verify

  • Lighthouse Accessibility panel no longer lists "Background and foreground colors do not have a sufficient contrast ratio" or "Form elements do not have associated labels" on any template.
  • In Chrome DevTools, inspect a text element and hover its colour in the Styles pane: the contrast ratio shows a green check for AA.
  • In DevTools > Elements > Accessibility pane, each input shows a Computed Name taken from its label.
  • Re-run the site audit and confirm the number of affected pages for this check drops to zero.

⚠️ Common mistakes

  • Relying on placeholder text as the only label for a field.
  • Fixing colours with inline overrides on individual pages instead of the shared theme token, so other templates keep failing.
  • Hiding labels with display:none or visibility:hidden, which removes them for screen readers as well.
  • Testing only the default state and forgetting hover, placeholder, cookie-banner and popup-form text.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

What contrast ratio does WCAG require for text?

WCAG 2.2 Level AA requires 4.5:1 for normal text and 3:1 for large text (24px regular or about 18.66px bold). Level AAA raises this to 7:1 and 4.5:1. Logos and purely decorative or disabled elements are exempt.

Does colour contrast affect SEO rankings?

Contrast is not a direct Google ranking factor, but it lowers your Lighthouse Accessibility score and affects readability, engagement and form conversions. Accessible labels also help automated agents and AI tools understand and complete your forms.

Is aria-label as good as a visible label?

It gives screen readers a name, so it passes the check, but visible labels help everyone, including users with cognitive disabilities and voice-control users who speak the visible text. Use a visible or visually hidden <label> first and aria-label for icon-only controls.

Why does my contrast checker pass but the audit still fails?

Usually the failing text is on a different background than you tested (a grey card, a hover state, an image), has reduced opacity, or sits in a component that only appears on some templates like a popup or footer form. Check the exact element and background values reported by axe or Lighthouse.