Skip to content
easeweb
Search topics

Links in body text marked only by colour

Links inside paragraphs have their underline removed, so a colour close to the body text is all that sets them apart.

WCAG 2.2
SC 1.4.1A
Required by
Section 508 · EN 301 549 (EU)
Broken text-decoration: none
The accessibility problem illustrated: Colour vision:Where are the links?
01

The problem

People who can't tell the link colour from the text colour can't find the links in a paragraph

02

Try it

Find the two links in the paragraph, then point at them or press Tab

Turn on greyscale to see the paragraph as many people with a colour vision deficiency do. Can you still tell where the links are?

Simulate Greyscale

Broken Can you fix this?

BrokenLinks set apart only by a colour close to the text

Caring for your olive tree

Water twice a week in summer, and read our winter care guide before the first frost. Large pots ship separately, so check the delivery policy before you order.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give links in running text a cue besides colour

Before
BrokenLinks set apart only by a colour close to the text
body {  color: #1a1a1a;}a {  color: #285c99; /* 6.82:1 on white, 2.55:1 against the text */  text-decoration: none;}
What is wrong2 points

The link is readable, at 6.82:1 on white, but it is marked by hue alone.

  • Nothing but colour shows that the words are links: text-decoration: none takes away the underline.
  • Without its hue, the link is one more dark word in the sentence. The blue is only 2.55:1 against the body text, where a colour difference needs 3:1 to count on its own.
After

An underline on links in running text

.prose a {  color: #285c99;  text-decoration: underline;  text-decoration-thickness: 1px;  text-underline-offset: 0.2em;}.prose a:hover,.prose a:focus-visible {  text-decoration-thickness: 2px;}
How it is fixed4 steps
  1. Underline the links with text-decoration: underline. The underline is a cue that does not depend on colour at all, so the link stands out in greyscale, under every colour vision deficiency, and in forced colors, where the browser keeps it.
  2. Set text-underline-offset, so the line stays clear of descenders.
  3. Thicken the line on hover and focus, so it still shows which link is under the pointer or the keyboard.
  4. Scope it to .prose, so it stays on links in running text and leaves menus and buttons alone.

This fixes the Before and passes 1.4.1.

04

Design ideas

An underline has more than one look

Four more ways to draw the same link, in the guide’s own colours. Point at them and Tab to them: three keep a cue at rest, and one only looks as if it does.

In the design file

  • Underline links even when nobody points at them, 1 pixel thick and set a little below the letters.
  • Draw the hover, focus and visited states, and keep the underline in all of them.
  • Write the link colour’s contrast ratio next to it, at least 4.5:1 against the page. If links get their underline only on hover, it also needs 3:1 against the body text.

Passes

  • Read our winter care guide first.
    Underline in a lighter tint A 2px line in #5d88c7, 3.61:1 against the page, so it still reads as a line. It darkens to the link colour on hover and focus.
  • Read our winter care guide first.
    Marker highlight, with the underline A pale band behind the words grows on hover, as editorial sites do it. The underline stays, because a background colour alone is still colour.
  • Read our winter care guide first.
    Dotted, solid on hover A dotted underline is quieter in a dense paragraph and still a shape, not a colour. It turns solid on hover and focus.

Fails

  • Read our winter care guide first.
    Underline that slides in on hoverWCAG 1.4.1 The sliding line is a pleasing touch, but it comes only with the pointer: at rest the #285c99 link is 2.55:1 against the #1a1a1a text, colour alone, and a touch screen never shows the line. Slide a thicker line in over a thin one that is always there.
05

Verify the fix

5 checks.

Test with: Contrast measurement, Mouse, Keyboard, Touch, Forced colors

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the colour tokens or the content styles change.

Limits

This is a starting pattern, not a guarantee for every application. Colour values are examples; measure your own palette against your real text and backgrounds. This guide covers links in running text. Colour used alone elsewhere, such as a red border for an error, a green dot for "in stock" or lines in a chart, fails the same criterion and needs its own cue, such as text or a pattern; status dots told apart by colour alone shows that fix for a status. Check the complete pages with people who rely on it.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service