无论如何要在ie8中使nth-child()工作

时间:2014-07-17 12:57:32

标签: html css3 internet-explorer internet-explorer-8

我在我的网站中使用nth-child()('奇怪'甚至'偶数')

在除ie8之外的所有浏览器中都可以正常工作,而不使用任何js或jquery。

我们可以在ie8中使用这些伪类。

(我不应该使用任何js或Jquery)

先谢谢:)

建议请。

我的代码是这样的,

.row-strip{
float: left;
min-height: 1px;
padding: 0px 3px;
&:nth-child(even){
    background-color: @tableRowZebraBackgroundColor;
}
&:hover{
    background-color: @tableRowHoverBackgroundColor;
    cursor: pointer;
}

}

请您详细说明如何为ie8做完,

var childnumber = document.querySelectorAll('.row-strip:nth-child(3)');

1 个答案:

答案 0 :(得分:1)

是的,你可以使用querySelectorAll,它在IE8中运行良好。

var childnumber3 = document.querySelectorAll('div:nth-child(3)');
相关问题