Underline in Links

Links (<a href="#">...</a>) in a page should definitely stand out from regular text. The implementation of a different color as well as underlines for hyperlinks pronounces a feeling of external linkage. This is a fair use of CSS styling, as long as the colour of the link is not the ugly default blue.

ugly_blue_link.png

The color is styled. But notice how the color of the underline is also styled to the color of the text? It may seem consistant for a design to have its links the same colors, but the purpose of the underline is to emphasize the text of the link, not the underline itself as it’s technically not part of the link. You’ll notice the color of the underlines of the links on this site are slightly lighter than the actual link color. This will effectively visually isolate the link but not make a big deal out of it.

links_underline.png

The technical part of this effect is to use CSS to get rid of the underline (yes, get rid of it), and add a border to the bottom of the link. For example:

a {
    color: #000066;
    text-decoration: none;
    border-bottom: 1px solid #bfbfc8;
}

Of course, a nice hover effect would conclude this nicely. A brighter text color and darker underline should do it.

a:hover {
    color: #000099;
    text-decoration: none;
    border-bottom: 1px solid #a6a6b2;
}

And that’s it!

post a comment5 Comments

  1. 1May 10th, 2006Steve Tucker says

    Good to see some short articles on simple yet invaluable subjects emerging again. Titbits like this are so much easier to swallow! Thanks Oliver.

  2. 2May 10th, 2006Angelina says

    Finally. A tutorial that even I can understand. xD

  3. 3May 10th, 2006EngLee says

    Good for CSS beginners. :)

  4. 4May 11th, 2006Joshua Jenkins says

    You’ve actually managed to address something extremely important here, but I’m afraid that people may take it for granted. It’s a no brainer on the technical side, but speaking strictly from a design standpoint your opinion on the links is pure genius. I’ve never heard anyone actually explicitly mention this before, so it’s nice to see.

    Very impressed with the article man, you’re doing great.

  5. 5May 11th, 2006Oliver Zheng says

    Thanks!

    Joshua, you are right. I took it for granted too when I first saw this on Daring Fireball. It seems too natural and nice to think about it logically.

    Angelina, finally a tutorial even you can understand :P

Post a Comment

Name and email are required (website is optional). Basic HTML is enabled.

Your email address is not revealed to anyone.