悬停效果不适用于IE8

时间:2011-06-07 18:21:17

标签: html css internet-explorer-8 hover doctype

我使用CSS在悬停表格时进行颜色更改

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

这在Chrome和Firefox中运行良好,但在Internet Explorer 8中不会发生悬停效果。

有没有办法让这个效果也适用于IE8?

3 个答案:

答案 0 :(得分:32)

应该在IE8中正常工作。

在黑暗中刺伤:

确保您有a doctype作为触发标准模式的HTML的第一行,例如:

<!DOCTYPE html>

Quirks Mode中,IE模拟版本5.5,该版本不支持:hover以外的元素上的a

答案 1 :(得分:3)

IE8不是:hover问题的常见罪魁祸首。如果你不能让它工作,总会有jQuery!

$("#tabb tbody tr").hover(
    function() {
        $("this").children("td").css( { 'background-color': '#d0e4f2', 'color': '#006' } );
    },
    function() {
        $("this").children("td").css( { ... } );
    }
);

答案 2 :(得分:0)

我的猜测是你桌面的html代码中不可思议的东西。正如你在这个快速而肮脏的小提琴上看到的,你的css是好的:

http://jsfiddle.net/PwZsN/

相关问题