Click to See Complete Forum and Search --> : underline


stormrevolution
12-11-2003, 05:43 PM
Looked everywhere, ive lost the code where you can get rid of the horrid underlines under textlinks and cannot find it on the web (Weird no?)

If someone could give me a link to it or just paste it here it would be great.

thanks in advance!

David Harrison
12-11-2003, 05:46 PM
No JavaScript needed:

<a href="#" style="text-decoration:none;">foo</a>

stormrevolution
12-11-2003, 05:52 PM
hmm thats almost the one i was looking for, but i want the one where the is no underline until you rollover the link then a underline appears.

Mouseout
Link
Mouseover
Link

Cheers!

David Harrison
12-11-2003, 05:55 PM
So why didn't you just say that in the first place?

<style type="text/css"><!--

.roll a, .roll a:link, .roll a:visited{text-decoration:none;}
.roll a:focus, .roll a:hover, .roll a:active{text-decoration:underline;}

--></style>

</head>

<body>

<span class="roll"><a href="#">foo</a></span>

Paul Jr
12-11-2003, 07:50 PM
Originally posted by lavalamp
.roll a:focus, .roll a:hover, .roll a:active{text-decoration: underline;}

I was just wondering what the a:focus part was for? I've never seen this used before.

Jeff Mott
12-11-2003, 08:18 PM
http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes