underline color

windows

Guest
how can I change the default color of the line under text -- for say a:link or a:hover?


Thanks

BenThis should do it:



a{
text-decoration:none;
display:block;
border-bottom:1px solid #f00;
}

The problem is that your link will have to be a block level element and you will have to give it a width and float text around it.Originally posted by lavalamp
This should do it:



a{
text-decoration:none;
display:block;
border-bottom:1px solid #f00;
}

The problem is that your link will have to be a block level element and you will have to give it a width and float text around it.
Seems like a little too much effort to go through just to change the underline color. Why would it have to be a block element? Would inline not work? If so, why?
-DanUnderline color is always the same color as the text. If you want to use different color, you use border-bottom instead of text-decoration for a similar visual effect.
Element does not need to be a block nor it needs a specified width to have a border. It will work with inline elements just fine.Oh, I thought that only block level elements could have borders. Never mind.
 
Back
Top