antonscie antonscie - 1 year ago 35
CSS Question

nth child using formula

hello i have like 6 thumbail who have same class for each thumbnails.
i want the 2nd,5th to have

and the 3nd and 6th to have

so i write css like this

margin:10px 15px;
.commitee-members-outers:nth-child(3n+2) .commitee-members{
margin-left: 36px;
.commitee-members-outers:nth-child(3n+3) .commitee-members{
margin-left: 83px;

i dont know why, but the 5th class got
and he 6th class didnt have
so i check with some exercise but this time its work
heres my case

as you can see, its messed up

but on this exercise
its work, please help

Answer Source

This will select 3rd and 6th element in your code.

.commitee-members-outers:nth-child(4n+3) .commitee-members{
    margin-left: 83px;