So I’m creating a hexagon pattern with CSS3, and I’d like it to look like this;
I’m having my hexagons float:left in a body of a certain width. I can effectively accomplish the results in the link above if I can select the first element in every other row. What would be the nth-child formula for that?
It would be the 5th element, then every 7th element after that?
The formula is
:nth-child(7n+5). The7nrepresents “every 7th element” and the+5represents “starting from the 5th element”.More on
:nth-child()in the Selectors spec.