Hello, I have several divs and some of them have a 'test' class, I would like the first-child selector to highlight only the first DIV that has the 'test' class, however, it only works if the 'test' class is in the first div. From what I understand, the selector takes the first object of the type and not the class actually. Does anyone have any ideas? In this example below, I wanted the div with "Test 2" to be highlighted by the selector (it is the first DIV that has the test class).
.teste:first-child{
background-color:#F00;
border:solid 4px #33CCCC;
}
<div>
Teste 1
</div>
<div class="teste">
Teste 2
</div>
<div class="teste">
Teste 3
</div>
<div class="teste">
Teste 4
</div>