I am trying to select the first child inside some other elements. This is the example.
<div class="parent">
<div class="feature">
<div class="some"></div>
</div>
<div class="feature">
<div class="some"></div>
</div>
<div class="feature">
<div class="required">I NEED TO SELECT THIS</div>
</div>
<div class="feature">
<div class="required">NOT THIS</div>
</div>
</div>
I want to select first occurrence of required. And also there can be arbitrary numbers div with .feature ( with .some) before i get to div which contains .required .
Can this be done ?
What i tried. (not working)
.parent .required:first-child {}
.parent .required:first-of-type {}