tr td:nth-child(2){ background-color:gray; }
就是tr當中的td的第二個td的屬性
tr:nth-child(2n+0){ background-color:#F0F0F0; }
這個是tr的2的倍數的
使用公式 (an + b)。描述:表示周期的長度,n 是計數器(從 0 開始),b 是偏移值。
在這里,我們指定了下標是 3 的倍數的所有 p 元素的背景色:
p:nth-child(3n+0)
{
background:#ff0000;
}