Hover effects not working with IE8

后端 未结 3 1453
慢半拍i
慢半拍i 2020-11-28 15:02

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 Ch

相关标签:
3条回答
  • 2020-11-28 15:37

    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( { ... } );
        }
    );
    
    0 讨论(0)
  • 2020-11-28 15:46

    my guess is something wonky in your html code for the table. as you can see on this quick and dirty fiddle, your css is a-ok:

    http://jsfiddle.net/PwZsN/

    0 讨论(0)
  • 2020-11-28 15:58

    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.

    0 讨论(0)
提交回复
热议问题