6

So I'm creating a hexagon pattern with CSS3, and I'd like it to look like this;

http://www.upperfirst.com

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?

4

1 回答 1

23

公式是:nth-child(7n+5)。代表“7n每 7 个元素”,+5代表“从第 5 个元素开始”。

更多关于:nth-child()选择器规范

于 2012-05-24T07:26:00.647 回答