不區分類型:
:first-child; 選中同級別中的第一個標籤
:last-child; 選中同級別中的最後一個標籤
:nth-last-child(n); 選中同級別中倒數第n個標籤
:nth-child(n); 選中同級別中的第n個標籤
:only-child; 選中同級別中唯一子元素標籤
區分類型:
:first-of-type; 選中同級別中同類型的第一個標籤
:last-of-type; 選中同級別中同類型的最後一個標籤
:nth-of-type(n); 選中同級別中同類型的第n個標籤
:nth-last-of-type(n); 選中同級別中同類型的倒數第n個標籤
:only-of-type; 選中同級別中同類型的唯一標籤
奇偶選擇:
:nth-child(odd); 選中同級別中同類型的奇數標籤
:nth-child(even); 選中同級別中同類型的偶數標籤
:nth-child(nx+y); 選中同級別中同類型的第(nx+y)個標籤(n從第0開始遞增計數,到元素的總個數上限停止)