IE:使用奇数/偶数的 nth-child() 不起作用

我的表格(在 Chrome、FireFox 和 Opera 上完美运行)在 Internet Explorer 上显示不正确.

My table (that works perfectly on Chrome, FireFox and Opera) is not displaying correctly on Internet Explorer.

背景保持白色!(我使用的是 IE-8)

The background remains white! (I am using IE-8)

CSS 代码:

/*My Table*/
.my_table{
border-collapse:collapse;
font:normal 14px sans-serif,tahoma,arial,verdana;
margin:5px 0;
}

.my_table th{
color:#fff;
background:#5E738A;
border:1px solid #3C5169;
text-align:center;
padding:4px 10px;
}

.my_table td{
color:#555;
border:1px solid #C1CAD4;
text-align:center;
padding:2px 5px;
}

.my_table tr:nth-child(even){
background:#E6EDF5;
}

.my_table tr:nth-child(odd){
background:#F0F5FA;
}

推荐答案

恐怕IE8不支持nth-child选择器:

IE8 doesn't support the nth-child selector I'm afraid:

http://reference.sitepoint.com/css/pseudoclass-nthchild

相关文章