天天看點

css選擇器指定元素中第幾個子元素

tr td:nth-child(2){
    background-color:gray;
}      

就是tr當中的td的第二個td的屬性

tr:nth-child(2n+0){
    background-color:#F0F0F0;
}      

這個是tr的2的倍數的

p:nth-child(3n+0)
{
background:#ff0000;
}