10

Sep

Estimated reading time: 1 minute, 4 seconds

dotted

Sick and tired of boring old underlines to show that a bit of text is a link? Here’s a really quick bit of CSS to show a dotted underline on your links (like this).

dotted-url

It’s so easy to do this that it hurts. We’re just swapping the underline for a border.

Dotted Underline on Hover Only

a:link, a:visited {
text-decoration: none; }
a:hover {
border-bottom: 1px dotted #000; }

What this does is remove the underline from the text so that when it’s not being hovered over there’s no underline. On hover, the dotted border appears.

Dotted Underline At All Times

a:link, a:visited {
text-decoration: none;
border-bottom: 1px dotted #000; }

This removes the underline and replaces it with the dotted border at all times.

Obviously a dotted border isn’t the only option out there. Play around with the other options and see what looks good and fits your site the best. Here’s the list of all of the types of borders that you can do.

CSS Border Types

p.solid {border-style: solid; }
p.double {border-style: double; }
p.groove {border-style: groove; }
p.dotted {border-style: dotted; }
p.dashed {border-style: dashed; }
p.inset {border-style: inset; }
p.outset {border-style: outset; }
p.ridge {border-style: ridge; }
p.hidden {border-style: hidden; }

Exciting Stuff

  • 06/01/10: My article "The Ten Commandments of Social Media" was referenced in the June/July 2010 edition of Chartered Accountants Magazine. An online version of the article can be read here.
  • 01/02/10: I was featured in an article in the Daily Gleaner written by Molly Cormier.
  • 11/03/09: "The Ten Commandments of Social Media" is published at Noupe.com.
  • 08/22/09: I was featured in an article in the New Brunswick Business Journal written by Chris Fox.