【发布时间】:2012-09-04 17:06:42
【问题描述】:
我需要将表格的每两行设为灰色,如果可能,我更愿意使用 nth-child。
我已经搞砸了Chris Coyier's nth-child tester,但仍然无法得到它。
我需要以下公式:
1,2 - grey
3,4 - white
5,6 - grey
7,8 - white
9,10 - grey
等等。我不想在 html 中放置一个类,因为我确信这将是一些人的建议。如果有办法用 nth-child 解决这个问题,那就是我正在寻找的。p>
【问题讨论】:
-
请发布您的代码,您尝试了什么?
标签: css css-selectors