table tr:nth-child(odd) {
background-color: #f1f1f1;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
如上,:nth-child(odd)匹配序列号为奇数的元素,:nth-child(even)匹配序列号为偶数的元素。
Angular JS伪类选择器(奇偶行样式)
阅读 69
2023-04-17
table tr:nth-child(odd) {
background-color: #f1f1f1;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
如上,:nth-child(odd)匹配序列号为奇数的元素,:nth-child(even)匹配序列号为偶数的元素。
相关推荐
精彩评论(0)