Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS issue: a:hover not working with IE (css Ninja needed)

Why does IE not change the background color on my site for tabs a:hover but does so in Firefox/Chrome/Safari correctly?

What can I do to make it work in IE 6+?

HTML

<ul class="tabbernav">
<li class="tabberactive"><a title="All" href="javascript:void(null);">All</a></li>
<li class=""><a>Tab1<span class="tabTotal"> (0)</span></a></li>
<li class=""><a>Tab2<span class="tabTotal"> (2)</span></a></li>
<li class=""><a>Tab3<span class="tabTotal"> (1)</span></a></li>
</ul>

CSS

ul.tabbernav li a:hover {background:#fdfdfd; border: 1px solid #555; border-bottom: none; color:#3366a9; cursor: pointer}
like image 260
TimJK Avatar asked Aug 18 '09 01:08

TimJK


2 Answers

You should place href="" attribute in <a> tag.

This will work fine.

Also use the <!doctype html> tag at the top of the page. Now everything will be fine.

like image 116
thinzar Avatar answered Oct 21 '22 01:10

thinzar


Try adding:

display: block;
position: relative;

to your css a.

like image 25
DLF Avatar answered Oct 21 '22 02:10

DLF