• Skip to main content

Rafal Tomal

Learn Design and Create Better Websites

  • About
  • Courses
  • Tools
  • Tips
  • Blog
  • Contact
  • Work With Me →

← More Design Tips

How To Style Better Link Underlines

posted on May 8, 2019

TweetFacebookLinkedInPin

When you use text-decoration: underline; in CSS it sometimes creates a strong line that may seem darker than the actual text, for example:

You don’t have full control over the underline style, but you can use, for example, border-bottom: 1px solid #C9A4F0;, to create a lighter and more appealing underline that is still clearly visible, for example:

I recommend increasing the brightness for underlines so they’re lighter than the text color. You can also experiment by leaving the text black and using a color underline to achieve some interesting effects like this one I did in Nathan Barry’s site design:

If you want underlines to hide behind the text and make a highlight effect on hover, you can use box-shadow, for example:

a { box-shadow: inset 0 -1px 0 0 #F9CE21;}
a:hover { box-shadow: inset 0 -30px 0 0 #F9CE21; }

I use this method on my own website:

tags: code typography ui ux

Previous tip: Choose a body typeface with medium to high x-height
Next tip: Organizing Project Files in Figma

Don't Miss Future Design Tips

Join 20k+ people who love good design. Get my best tips, resources, and strategies to elevate your design skills and grow your business.

© Copyright 2008 - 2025 Rafal Tomal.

Affiliate Program . Privacy Policy . Cookie Policy . License .

Follow me on Twitter, Dribbble, and Instagram.

DISCLOSURE: I may be an affiliate for products that I recommend. If you purchase those items through my links I will earn a commission. You will not pay more when buying a product through my link. It helps me to continue to offer you lots of free stuff. Thank you, in advance for your support!