我有一个html:
<div class="test>
<span>Yellow</span>
<span>Blue</span>
<span>Purple</span>
</div>
我希望隐藏包含文本“黄色”和“紫色”的跨度。我可以用CSS做到吗?也许是属性?跨度没有课程,或者换句话说,它们就没有课程。
.test span:nth-of-type(1) {
// this gets you the first one
}
.test span:nth-of-type(2) {
// this gets you the second one
}
等