Recurring design elements?

Hello. The question how to implement a repeating design elements. Probably not clear, here's a picture:
59d4125d75b5b963978932.png
https://jsfiddle.net/bv51y5c5/
4 elements decorated color at a time. On 5 an item you need to bring back the red, six blue, black seventh and eighth green. In a circle in the General case. If a lot of these elements, you will not work every ordinal in the tree to paint the desired color. Don't even know whether it is possible with the help of pseudoelements to solve the problem. Asking for help from you experts
June 14th 19 at 20:20
1 answer
June 14th 19 at 20:22
Solution
<div class="a"></div>
................................
<div class="a"></div>

.a:nth-child(4n+1){ background-color: red;}
.a:nth-child(4n+2){ background-color: blue;}
.a:nth-child(4n+3){ background-color: black;}
.a:nth-child(4n+4){ background-color: green;}
Great! Thank you very much! - Hosea_Hans commented on June 14th 19 at 20:25

Find more questions by tags CSS