Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
.list > li:nth-of-type(1) {
background-color: violet;
}
.list>li:first-of-type {
background-color: green;
}
.list > li:nth-of-type(8) {
background-color: violet;
}
.list>li:last-of-type {
background-color: yellow;
}
.list>li:nth-last-of-type(4) {
background-color: red;
}
层级:>,空格
平级:+,~
.list> :nth-of-type(n+3) {
background-color: green;
}
计算过程:
.list> :nth-of-type(-n+3) {
background-color: green;
}
计算过程: