Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hover effects not working with IE8

I used CSS for a color change on hover for a table

#tabb tbody tr:hover td{
    color:#006;
    background:#d0e4f2;
}

This works fine in Chrome and Firefox, but the hover effect does not happen in Internet Explorer 8.

Is there a way to make this effect work with IE8 as well?

like image 963
Lazer Avatar asked Jun 07 '11 18:06

Lazer


2 Answers

That should work fine in IE8.

A stab in the dark:

Make sure you have a doctype as the very first line of your HTML that triggers Standards Mode, such as:

<!DOCTYPE html>

In Quirks Mode, IE emulates version 5.5, which does not support :hover on elements other than a.

like image 170
thirtydot Avatar answered Oct 07 '22 17:10

thirtydot


IE8 is not the usual culprit for :hover problems. If you can't get it to work, there's always jQuery!

$("#tabb tbody tr").hover(
    function() {
        $("this").children("td").css( { 'background-color': '#d0e4f2', 'color': '#006' } );
    },
    function() {
        $("this").children("td").css( { ... } );
    }
);
like image 27
Wex Avatar answered Oct 07 '22 16:10

Wex