views:

1556

answers:

5

I am using a piece of html something like the following:-

<a class="somePseudoClass" title="Blablabla">Something</a>

and I have the following css in an imported file.

a.somePseudoClass:hover  {color: #000000; text-decoration: underline;}

This works perfectly in Firefox 2.0 but in IE6 the underline fails to show.

Does anyone know of a workaround?

A: 

this should work, but it depends on what other CSS declarations you have (before and after it)

scunliffe
+8  A: 

Looks like you need a href attribute to make it work...

a.somePseudoClass         {text-decoration: none;}
a.somePseudoClass:hover   {color: #000000; text-decoration: underline;}
<a class="somePseudoClass" title="Blablabla" href="#" onclick="return false;">Something</a>
PhiLho
+1 IE only honors pseudoclasses on hyperlinks but not anchors, which means you must have an href.
Adam Lassek
A: 

How are you disabling the underline in the first place? Perhaps that is overriding this.

If you start with only your example on the page, and use text-decoration: underline, it seems to work fine. It's not IE, it's something else on your page.

Diodeus
A: 

I just had this with ie6 and found this mssage here by googling. My problem was the line height was set to the same as the font height. FF, Chrome, Safari and ie8 all showed the underline, but ie6 was cutting it off, so no amount of searching for overriding css elements or whatever would have found this.

A: 

hello ,

in IE 6 :

div#nav a {

text-decoration:none; }

a:link is not defined in IE 6 .

karim mohammadi