<p></p>
<p></p>
<p></p>
p{
width: 100px;
height: 100px;
margin: 10px;
border: 1px solid #000;
display: inline-block;
}
d3.selectAll("p").style("background", function(d, i) {
return i % 2 ? "#fff" : "#000";
});
This Pen doesn't use any external CSS resources.