1、同級別:
:first-child 選中同級別中的第一個標簽
:last-child 選中同級別中的最后一個標簽
:nth-child(n) 選中同級別中的第n個標簽
:nth-last-child(n) 選中同級別中的倒數第n個標簽
:only-child 選中父元素中唯一的子元素
注意點:不區分類型
2、同類型:
:first-of-type 選中同級別同類型的第一個標簽
:last-of-type 選中同級別同類型的最后一個標簽
:nth-of-type(n) ?選中同級別同類型的第n個標簽
:nth-last-of-type(n)? 選中同級別同類型的倒數第n個標簽
:only-of-type ?選中的是父元素中唯一類型的某個標簽