I am looking to design a block of 30 div which consist of 4 different colour and should be repeat using a same CSS. I have tried couple of different methods and found CSS NTH child to be most efficient among all.
But I am facing an issue while declaring it on every 4 block because I am using WordPress managed hosting so my website is on staging URL.
I am not sure whether it should be done through CSS or should I use Javascript.
I have followed W3School NTHChild Resource
p:nth-child(odd) {
background: red;
}
p:nth-child(even) {
background: blue;
}