I want to select only the first box--highlight
.
<ul>
<li>
<a class="box "></a>
</li>
<li>
<a class="box box--highlight"></a>
</li>
<li>
<a class="box box--highlight"></a>
</li>
<li>
<a class="box "></a>
</li>
</ul>
I was trying around with the adjacent siblings combinator but it did not work as expected
li .box--highlight + li .box--highlight {
color: green;
}
Is this even possible? I was wondering if the answer is already to select the parent selector (which is not possible of course): Is there a CSS parent selector?