I need to set a class for multiples divs and each one of them with different background-color.
<div class="genericClass">Some Text</div> <!-- This should be #000 -->
<div class="genericClass">Some Text</div> <!-- This should be #FFF -->
<div class="genericClass">Some Text</div> <!-- This should be #B1B -->
<div class="genericClass">Some Text</div> <!-- This should be #DDD -->
.genericClass{
background-color: #000; /* this should be the first */
background-color: #FFF; /* this should be the second */
background-color: #B1B; /* this should be the third */
background-color: #DDD; /* this should be the fourth */
}
But I don't know how I can do that.
EDIT: I have no chance to know how many items could be added, so, the pattern should repeat after four divs, so, it there is five divs, the last one should take the #000 (first) color.