Forum Moderators: not2easy

Message Too Old, No Replies

How to change underline color without changing text color

         

dougmcc1

8:37 pm on Oct 4, 2003 (gmt 0)

10+ Year Member



How do you change the color of only the underline on links? I don't want to change the color of the text, just the color of the underline.

Thanks.

SuzyUK

9:39 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No can do on the underline property.. the color referred to is the foreground color.. and you cannot specify different foreground colors on the same element (text & text decoration are the same, they are both foreground properties)

however if you remove text-decoration and do it with a bottom border instead then you should be able to specify different colours that way...

Suzy

aevea

9:57 pm on Oct 4, 2003 (gmt 0)

10+ Year Member



You can do it by using border-bottom on your links instead of text-decoration:

 :link, :visited {text-decoration: none; border-bottom: 1px solid #bedfed; }
:hover, :active {text-decoration: none; border-bottom: 1px solid #fedbed; }

Adam

dougmcc1

2:13 pm on Oct 6, 2003 (gmt 0)

10+ Year Member



Thanks, I thought about that but I wanted to be sure it couldn't be done more "cleanly" with underline-color or something first.

Thanks again.