我
如下代码中文本“Sausage”的颜色
难度:
html
<ul class="shopping-list" id="awesome">
<li><span>Milk</span></li>
<li class="favorite" id="must-buy"><span class="highlight">Sausage</span></li>
</ul>
css
ul {
color: red;
}
li {
color: blue;
}
blue。
css
ul {
color: red;
}
#must-buy {
color: blue;
}
blue。
css
.shopping-list .favorite {
color: red;
}
#must-buy {
color: blue;
}
blue。
css
ul#awesome {
color: red;
}
ul.shopping-list li.favorite span {
color: blue;
}
blue。
css
ul#awesome #must-buy {
color: red;
}
.favorite span {
color: blue !important;
}
blue。
css
ul.shopping-list li .highlight {
color: red;
}
ul.shopping-list li .highlight:nth-of-type(odd) {
color: blue;
}
blue。
css
#awesome .favorite:not(#awesome) .highlight {
color: red;
}
#awesome .highlight:nth-of-type(1):nth-last-of-type(1) {
color: blue;
}
blue。