I have a list of divs that appear 4 in a row with a class and I would like to create a checkerboard background style, meaning:
Just after the solution from @Miszy, I also found a jQuery solution that does the same thing regardless of how many divs will appear on the page:
$(document).ready(function() {
$(.boxwrapper:nth-child(8n+3), .boxwrapper:nth-child(8n+5), .boxwrapper:nth-child(8n+8), .boxwrapper:nth-child(8n+10)").css({"background-color":"red"});
});
Either one will work fine.