7
Hello, I have several Ivs and some of them have a 'test' class, I would like the first-Hild selector to highlight only the first DIV that has the 'test' class, but 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 really. Anyone have any idea? 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>