Using nth-child with a looper

Hi,

I am making a looper with a div as the looper consumer. I’d like for the div’s background color to change using the CSS nth-child designator. However, when I try to do that it changes all the Divs in the looper. Before I spend too much more time trying to achieve this, I thought I’d ask if it is even possible.

Thanks,
Jen

Hello @petitshoo,

Thanks for writing in! You are using an element ID. Be advised that an ID must only appear once. You will need to use class instead.

You will then be using div.color-changing:nth-child(4n+1) in your custom CSS.

Be advised that custom CSS coding is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.