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:

nth-of-type

nth-child

.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

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -