3 replies [Last post]
kergo
Offline
newbie
Last seen: 16 years 19 weeks ago
Joined: 2004-09-11
Posts: 2
Points: 0

Hi,

Is there a way (except for the way to use border-bottom) to give the text color1 and the underline color2?

I see it sometimes on several sites but I don't know how to do that.

eff
Offline
Regular
Berlin, Germany
Last seen: 16 years 19 weeks ago
Berlin, Germany
Timezone: GMT+1
Joined: 2004-09-10
Posts: 18
Points: 0

Re: Text and underline with different colors

kergo wrote:

[...]
I see it sometimes on several sites
[...]

Post one, please...

Fruits rock!

kergo
Offline
newbie
Last seen: 16 years 19 weeks ago
Joined: 2004-09-11
Posts: 2
Points: 0

Text and underline with different colors

I found out that it just work with Firefox or Opera, not with IE.

I think it's like that:

HTML/PHP:
<a href="#"><span class="text"><font color="#FF0000">Headertext:</font> Exampletext</font></span>

CSS:
.text a:link, .text a:active, .text a:visited {
color: #000000;
}

.text a:hover {
text-decoration: underline;
}

eff
Offline
Regular
Berlin, Germany
Last seen: 16 years 19 weeks ago
Berlin, Germany
Timezone: GMT+1
Joined: 2004-09-10
Posts: 18
Points: 0

Text and underline with different colors

Yes, it does work. BUT:
When using CSS you should not be using the color attribute in the font tag.
There isn't even one in XHTML1.1...

I believe this hack is kind of gross...

Fruits rock!