nth-type-of 与 nth-child
:nth-type-of()
:nth-child()
匹配父元素的第n个子元素E,假设该子元素不是E,则选择符无效。
**
设置奇偶不同样式
.list li:nth-of-type(n) {background: #fff;}.list li:nth-of-type(2n) {background: #57f4c6;}

设置前n个元素的样式
.list li:nth-of-type(-n + 3) {
background: #57f4c6;
}

设置倒数n个元素的样式
.list li:nth-last-of-type(-n + 3) {
background: #57f4c6;
}

设置从n - 1个起的元素的样式
.list li:nth-of-type(n + 3) {
background: #57f4c6;
}

设置某一范围内元素的样式
.list li:nth-of-type(-n + 8):nth-of-type(n + 3) {
background: #57f4c6;
}

