Forum Moderators: not2easy

Message Too Old, No Replies

Dotted underlines

For my links

         

CherishedSites

11:48 am on Apr 5, 2005 (gmt 0)

10+ Year Member



Hello all,

Just a small question about my A tags in CSS: How can I give my links a dotted line underneath instead of a solid underline?

Any help would be most appreciated.

Thanks!

Alternative Future

12:11 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld CherishedSites,

Is it something like this you are after:

a {
border-bottom: dotted 1px #000000;
text-decoration: none;
}
a:active {
color: #f0f0f0;
}
a:visited {
color: #f0f0f0;
border-bottom: dotted 1px #000000;
}

There are some known issues with IE and it rendering the dots as more dashes.

-George

sifredi

12:16 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



Actually, you should switch the order of anchors to make it right in all browsers:

a {
border-bottom: 1px dotted #000;
text-decoration: none;
}
a:visited {
color: #f0f0f0;
border-bottom: 1px dotted #000;
}
a:active {
color: #f0f0f0;
}

MatthewHSE

2:00 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can add a dotted border to the bottom of links. Be aware, however, that this can cause very bizarre behavior under some circumstances.

moltar

2:23 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To avoid IE rendering problems, you can use a small image set as background of the anchor. The image should be one pixel tall and a few pixels wide. It should look like this:

....

Then you can attach it to the anchor like this:


a {
padding-bottom: 1px;
background: url("dots.gif") repeat-x bottom;
}

I haven't tested it, the code might be slightly off. I know this is possible though. I've seen it done.

CherishedSites

2:45 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



Thank you all for your help. I'll try a few of your suggestions and go with the one that suits me best. Thanks again!