table元素的td和ul元素li隔行變色的功能實現
利用css控制二者的樣式輕松實現隔行換色:
例如:table的css樣式控制:
table tr td{
background-color:顏色1
}
table tr td:nth-child(2n+1){
background-color:顏色2
}
ul的li樣式控制
ul li{
background-color:顏色1;
}
ul li:nth-child(2n+1){
background-color:顏色2;
}
table元素的td和ul元素li隔行變色的功能實現
利用css控制二者的樣式輕松實現隔行換色:
例如:table的css樣式控制:
table tr td{
background-color:顏色1
}
table tr td:nth-child(2n+1){
background-color:顏色2
}
ul的li樣式控制
ul li{
background-color:顏色1;
}
ul li:nth-child(2n+1){
background-color:顏色2;
}
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。