Style your underlines

We shouldn’t rely on colour alone to indicate that something is interactive.

Take links, for example. Sure, you can give them a different colour to the surrounding text, but you shouldn’t stop there. Make sure there’s something else that distinguishes them. You could make them bold. Or you could stick with the well-understood convention of underlying links.

This is where some designers bristle. If there are a lot of links on a page, it could look awfully cluttered with underlines. That’s why some designers would rather remove the underline completely.

As Manu observed:

I’ve done a lot of audits in the first half of this year and at this point a believe that designing links without underlines is a kink. The idea that users don’t understand that links are clickable arouses some designers. I can’t explain it any other way.

But underlining links isn’t the binary decision it once was. You can use CSS to style those underlines just as you’d style any other part of your design language.

Here’s a regular underlined link.

For a start, you can adjust the distance of the underline from the text using text-underline-offset. If you’re using a generous line-height, use a generous distance here too.

Here’s a link with an offset underline.

If you’d rather have a thinner or thicker underline, use text-decoration-thickness.

Here’s a link with a thin underline.

The colour of the underline and the colour of the link don’t need to be the same. Use text-decoration-color to make them completely different colours or make the underline a lighter shade of the link colour.

Here’s a link with a translucent underline.

That’s quite a difference with just a few CSS declarations:

text-underline-offset: 0.2em;
text-decoration-thickness: 1px;
text-decoration-color: oklch(from currentColor l c h / 50%);

If that still isn’t subtle enough for you, you could even use text-decoration-style to make the underline dotted or dashed, but that might be a step too far.

Here’s a link with a dotted underline.

Whatever you decide, I hope you’ll see that underlines aren’t the enemy of good design. They’re an opportunity.

You should use underlines to keep your links accessible. But you should also use CSS to make those underlines beautiful.

Have you published a response to this? :

Responses

16 Shares

# Shared by Tyler Sticka on Wednesday, August 13th, 2025 at 3:12pm

# Shared by Fynn Ellie Becker on Wednesday, August 13th, 2025 at 3:12pm

# Shared by mORA on Wednesday, August 13th, 2025 at 3:12pm

# Shared by Alex Russell on Wednesday, August 13th, 2025 at 3:12pm

# Shared by David Bushell 🥐 on Wednesday, August 13th, 2025 at 3:33pm

# Shared by J-P Teti on Wednesday, August 13th, 2025 at 3:44pm

# Shared by David O'Brien on Wednesday, August 13th, 2025 at 4:16pm

# Shared by Chris Palmer on Wednesday, August 13th, 2025 at 4:50pm

# Shared by Jay 🆘 on Wednesday, August 13th, 2025 at 5:21pm

# Shared by Hubert Sablonnière on Wednesday, August 13th, 2025 at 5:39pm

# Shared by Thomas Broyer on Wednesday, August 13th, 2025 at 6:05pm

# Shared by Moritz Glantz #a11y on Wednesday, August 13th, 2025 at 11:33pm

# Shared by Amy St. John on Thursday, August 14th, 2025 at 5:01am

# Shared by Ferdinand Vogler on Thursday, August 14th, 2025 at 6:35am

# Shared by Lyons on Friday, August 15th, 2025 at 2:18am

# Shared by Antoine on Thursday, August 21st, 2025 at 8:01am

37 Likes

# Liked by Evren Kiefer on Wednesday, August 13th, 2025 at 2:58pm

# Liked by Alex Bird on Wednesday, August 13th, 2025 at 3:12pm

# Liked by hirsebirse on Wednesday, August 13th, 2025 at 3:12pm

# Liked by Alex M on Wednesday, August 13th, 2025 at 3:12pm

# Liked by strongest on Wednesday, August 13th, 2025 at 3:12pm

# Liked by Tyler Sticka on Wednesday, August 13th, 2025 at 3:12pm

# Liked by Fynn Ellie Becker on Wednesday, August 13th, 2025 at 3:12pm

# Liked by Alex Russell on Wednesday, August 13th, 2025 at 3:12pm

# Liked by David Bushell 🥐 on Wednesday, August 13th, 2025 at 3:33pm

# Liked by Snook on Wednesday, August 13th, 2025 at 3:33pm

# Liked by Greg Daynes on Wednesday, August 13th, 2025 at 3:33pm

# Liked by Troels Thomsen on Wednesday, August 13th, 2025 at 3:44pm

# Liked by J-P Teti on Wednesday, August 13th, 2025 at 3:44pm

# Liked by Charles Choi 최 민수 on Wednesday, August 13th, 2025 at 3:44pm

# Liked by Charles Eckman on Wednesday, August 13th, 2025 at 3:44pm

# Liked by ⚠Invalid Handle on Wednesday, August 13th, 2025 at 4:04pm

# Liked by Alexander Markov on Wednesday, August 13th, 2025 at 4:16pm

# Liked by 𝕮 on Wednesday, August 13th, 2025 at 4:32pm

# Liked by Shannon Kay on Wednesday, August 13th, 2025 at 4:50pm

# Liked by Aaron In Minnesota on Wednesday, August 13th, 2025 at 4:50pm

# Liked by Jay 🆘 on Wednesday, August 13th, 2025 at 5:21pm

# Liked by Benji Smith on Wednesday, August 13th, 2025 at 5:21pm

# Liked by Hubert Sablonnière on Wednesday, August 13th, 2025 at 5:39pm

# Liked by Shawn Eisenach on Wednesday, August 13th, 2025 at 5:46pm

# Liked by twifkak on Wednesday, August 13th, 2025 at 5:46pm

# Liked by Thomas Broyer on Wednesday, August 13th, 2025 at 6:05pm

# Liked by Jordi Sánchez on Wednesday, August 13th, 2025 at 6:39pm

# Liked by Taylor “Tigt” Hunt on Wednesday, August 13th, 2025 at 7:55pm

# Wednesday, August 13th, 2025 at 8:12pm

# Liked by Paul Gould on Wednesday, August 13th, 2025 at 8:12pm

# Liked by felix (grayscale) 🐺 on Wednesday, August 13th, 2025 at 10:03pm

# Liked by 洪(홍)영수 (Hong Yeong Soo) on Wednesday, August 13th, 2025 at 11:35pm

# Liked by zabinetta 🏳️‍🌈 on Thursday, August 14th, 2025 at 12:42am

# Liked by Jez on Thursday, August 14th, 2025 at 4:16am

# Liked by Chris Ainsworth on Thursday, August 14th, 2025 at 7:11am

# Liked by Frank Noirot on Thursday, August 14th, 2025 at 12:09pm

# Liked by Lyons on Friday, August 15th, 2025 at 2:18am

Related posts

Making the website for Research By The Sea

Having fun with view transitions and scroll-driven animations.

Displaying HTML web components

You might want to use `display: contents` …maybe.

Schooltijd

Going back to school in Amsterdam.

Control

Trying to understand a different mindset to mine.

Talking about style

The transcript of a talk.

Related links

CSS-in-JS: The Great Betrayal of Frontend Sanity - The New Stack

This is a spot-on analysis of how CSS-in-JS failed to deliver on any of its promises:

CSS-in-JS was born out of good intentions — modularity, predictability and componentization. But what we got was complexity disguised as progress.

Tagged with

Responsive Letter Spacing – Cloud Four

Another clever use of clamp() and calc() for web typography, but this time it’s adjusting letter-spacing.

Tagged with

Custom Asidenotes – Eric’s Archived Thoughts

An excellent example of an HTML web component from Eric:

Extend HTML to do things automatically!

He layers on the functionality and styling, considering potential gotchas at every stage. This is resilient web design in action.

Tagged with

Write Code That Runs in the Browser, or Write Code the Browser Runs - Jim Nielsen’s Blog

So instead of asking yourself, “How can I write code that does what I want?” Consider asking yourself, “Can I write code that ties together things the browser already does to accomplish what I want (or close enough to it)?”

Tagged with

Who needs a flying car when you have display: grid

I’m not the only one who’s amazed by how much you can do with just a little CSS these days.

Tagged with

Previously on this day

5 years ago I wrote Season one of the Clearleft podcast

That’s a wrap!

5 years ago I wrote BetrayURL

You can kiss URLs goodbye after all.

10 years ago I wrote dConstruct 2015 podcast: Chriss Noessel

So much geekiness in one podcast episode.

11 years ago I wrote Anab Jain at dConstruct

The line-up for this year’s dConstruct just gets better and better.

12 years ago I wrote August in America, day ten

Sierra Vista, Arizona.

15 years ago I wrote Clarification

A spec by any other name would smell as sweet.

18 years ago I wrote Reflection

Balancing my time between activism and just being me makes me a complacent zealot.

22 years ago I wrote Brighton Bloggers

Even though I’m on holiday and I should be spending all my time swimming, sunbathing and eating tacos, I just couldn’t resist doing a bit of design work.