JSFiddle - React, Tailwind, and code Playground
HTML
<li>a</li>
<li id="b">b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
<li>g</li>
<li>h</li>
CSS
li:nth-child(3n){
background:orange;
}
li:nth-child(4n){
background:red;
}
#b:nth-child(2n){
background:yellow;
}