nth-of-type
I want to be able to get the divs by calling them "first, second, third" via nth-of-type now the problem is that this works:
.box:nth-of-type(1)
.box:nth-of-type(3)
.box:nth-of-type(5)
But I don't understand why I can't call them like that:
.box:nth-of-type(1)
.box:nth-of-type(2)
.box:nth-of-type(3)
It's going like this:
<div class="box"></div>
<div class="divider"></div>
<div class="box"></div>
<div class="divider"></div>
<div class="box"></div>
The problem is get fixed when I removing the two dividers which go between them (There are 2 divs called "divider") so I can call them like 1, 2, 3 but why should I need to call them 1, 3, 5 with the dividers? Also when I change the divs to whatever else like p or h1, etc... its okay and I can call them 1, 2, 3
Thank you for your help!