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 J-P Teti on Wednesday, August 13th, 2025 at 3:44pm

# Liked by Troels Thomsen 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 Benji Smith on Wednesday, August 13th, 2025 at 5:21pm

# Liked by Jay 🆘 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 Intelligence: Speculating On The Future Of A Smarter Language — Smashing Magazine

This is a really thoughtful look at the evolution of CSS and the ever-present need to balance power with learnability.

Tagged with

Polishing your typography with line height units | WebKit

I should be using the lh and rlh units more enough—they’re supported across the board!

Tagged with

Hiding elements that require JavaScript without JavaScript :: dade

This is clever: putting CSS inside a noscript element to hide anything that requires JavaScript.

Tagged with

Cascading Layouts | OddBird

A workshop on resilient CSS layouts

Oh, hell yes!

Do not hesitate—sign yourself up to this series of three online workshops by Miriam. This is the quickest to level up your working knowledge of the most powerful parts of CSS.

By the end of this you’re going to feel like Neo in that bit of The Matrix when he says “I know kung-fu!” …except kung-fu isn’t very useful for building resilient and maintainable websites, whereas modern CSS absolutely is.

Tagged with

Building WebSites With LLMS - Jim Nielsen’s Blog

And by LLMS I mean: (L)ots of (L)ittle ht(M)l page(S).

I really like this approach: using separate pages instead of in-page interactions. I remember Simon talking about how great this works, and that was a few years back, before we had view transitions.

I build separate, small HTML pages for each “interaction” I want, then I let CSS transitions take over and I get something that feels better than its JS counterpart for way less work.

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.