HTML历理 ICbA的隔N行变N行色

/*隔行变色*/
.m-tb2n tr:nth-child(2n){ background-color:#f9f9f9;}
.m-tb2n tr:hover{ background-color:#f2f2f2;}
.m-tb4n tr:nth-child(4n+3),.m-tb4n tr:nth-child(4n+4){ background-color:#f9f9f9;}
.m-tb6n tr:nth-child(6n+4),.m-tb6n tr:nth-child(6n+5),.m-tb6n tr:nth-child(6n+6){ background-color:#f9f9f9;}
.m-tb8n tr:nth-child(8n+5),.m-tb8n tr:nth-child(8n+5),.m-tb8n tr:nth-child(8n+7),.m-tb8n tr:nth-child(8n+8){ background-color:#f9f9f9;}

效果图:

posted @ 2024-05-30 21:19  onestopweb  阅读(10)  评论(0)    收藏  举报