...

View Full Version : <span> inside <a> - broken underline hover (IE)



thop
08-08-2005, 07:57 PM
The following code (which you can copy and paste as a complete file) works in Gecko browsers and Opera, but not IE.
What I'm trying to achieve is a single hyperlink for which some text underlines when hovered over, but the rest of the text does not (despite being part of the hyperlink). Does anyone know how this can this be achieved in Internet Explorer?

<html>
<head>
<style>
a {
text-decoration: none;
}
a:hover .test2 {
text-decoration: underline;
}
</style>
</head>
<body>
<a href="#"><span class="test2">One</span> Two</a>
</body>
</html>

Many thanks in advance for any help or ideas you can provide.

Kurashu
08-08-2005, 08:05 PM
<html>
<head>
<style>
a {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
a:hover .test2 {
text-decoration: none;
}
</style>
</head>
<body>
<a href="#">One <span class="test2">Two</span></a>
</body>
</html>

thop
08-08-2005, 08:17 PM
Thank you Kurashu!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum