css选择器的一些小操作

nth-child(n+1):nth-child(-n+3) 选择前三个
nth-child(n+2):nth-child(-n+5)这表示从第二个选到第五个
ul li:nth-child(n):nth-child)(-n+5){}等同于
ul li:nth-child(1),ul li:nth-child(2),ul li:nth-child(3),ul li:nth-child(4),ul li:nth-child(5){}

点赞

发表评论