nth-child(n)
ele:nth-child(n)
选中ele元素,且ele是某个元素下的第n个元素
p:nth-child(n) ---->选中p元素,且该p元素必须是某个父元素下的第n个子元素
这里的n是从1开始的
li:nth-child(n+6)
:选中从第6个开始的子元素(即n从0开始)
:nth-child(-n+9)
:选中从第1个到第9个子元素
nth-last-child(3)
:选中倒数第三个
nth-of-type
ele:nth-of-type选中的是某个元素下的第几个ele类型的元素。
https://blog.csdn.net/lonecry/article/details/87864416