标签:
.my_table tr:nth-child(even){
background:#E6EDF5;
}
.my_table tr:nth-child(odd){
background:#F0F5FA;
}
.table_border table tr.even{background: #f8f8fb;}
$(".nav ul li div a:nth-child(even)").css({‘background‘:‘red‘}); $(".nav ul li div a:nth-child(odd)").css({‘background‘:‘grey‘});
在网上看了看 还有第四种方法:
tr {background-color:expression((this.sectionRowIndex%2==0)?"red":"blue")}
td {background-color:expression((this.cellIndex%2==0)?"":((this.parentElement.sectionRowIndex%2==0)?"green":"yellow"))}
但是实践的时候发现第四种完全没有反应,如果你实践了有效果,请说说其中的原因吧。
第四种方法参考地址:
http://www.cnblogs.com/xiaofengfeng/archive/2011/01/18/1938453.html
css中table tr:nth-child(even)改变tr背景颜色: IE7,8无效
标签:
原文地址:http://www.cnblogs.com/moqiutao/p/4786565.html