ul下特定li样式的修改

ul li:first-child{ }  第一个
ul li:last-child{ }   最后一个
ul li:nth-child(4){ } 指定第几个,4就是代表第四个
ul li:nth-child(2n+1){background:red;}/*匹配第1、第3、第5、…个li*/
ul li:nth-child(odd){background:red;}   基数
ul li:nth-child(even){background:red;}  偶数

posted @ 2020-12-07 16:29  zeal666  阅读(392)  评论(0)    收藏  举报