Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] :nth-child not working as expected Reply To: :nth-child not working as expected

#149800
wolfcry911
Participant

It had nothing to do with specificity – but rather was not targeting anything.

You don’t want to target every other float child because there’s only one child for each container. You need to target the float child of every other container as Paulie has shown in his pen.

edit// is there a reason you’re using 2n+2 and not just 2n (not that it matters here)?