html - Understanding CSS child selector -
this question has answer here:
i'm not able use nth-child or nth-of-type of html structure below :
<div class="wrapper"> <div class="child_1">child 1</div> <div> not child 1 </div> <div class="child_1">child 1</div> <div class="child_1">child 1</div> </div> what want select 2nd child_1 can't find how. there 1 have answer me?
you can't select nth-of-type class. have target div instead.
from mdn:
.wrapper div:nth-child(3) { color: red; } <div class="wrapper"> <div class="child_1">child 1</div> <div> not child 1 </div> <div class="child_1">child 1</div> <div class="child_1">child 1</div> </div>
Comments
Post a Comment