CSS3设置Table奇数行和偶数行样式

table:
.myTable tr:nth-child(even){ //偶数行
background:#fff;
}
.myTable tr:nth-child(odd){ //奇数行
background:#f5f2eb;
}

ul列表:

#Ulist li:nth-of-type(odd){ margin-left: 20px;}奇数行   

#Ulist li:nth-of-type(even){margin-left: 10px;}偶数行   

原文地址:https://www.cnblogs.com/wanan-01/p/7489608.html