Folks,
i have 100 < p> tags and i'm trying to repeat a set of four color to every row in a bellow manner.
RED BLUE GREEN PURPLE RED BLUE GREEN PURPLE ....and so onThe output generated is not as i desired. The output is
RED BLUE GREEN PURPLE RED GREEN RED PURPLE GREEN BLUE RED PURPLEso if you have any suggestion that would be helpful for me, :)
here is my css code.
<style>
p:nth-child(1n) {
background: red;
}
p:nth-child(2n) {
background: blue;
}
p:nth-child(3n) {
background: green;
}
p:nth-child(4n) {
background: purple;
}
</style>
See Question&Answers more detail:os