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

TimJK picture TimJK · Aug 18, 2009 · Viewed 45.7k times · Source

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}

Answer

thinzar picture thinzar · Aug 18, 2009

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.