table 隔行变色

1 /*从第二行(偶数行)开始变色*/
2 table tr:nth-child(2n){
3       background-color:red;
4 }
5 
6 /*从第一行(奇数行)开始变色*/
7 table tr:nth-child(2n-1){
8       background-color:red;
9 }

 

posted @ 2018-05-16 09:50  樊琇鸿  阅读(198)  评论(0编辑  收藏  举报