這是html選擇器的測試題:? html選擇器測試題--帶答案_免費(fèi)高速下載|百度網(wǎng)盤-分享無限制
1,plate??????
元素選擇器????????? 語法:標(biāo)簽名 { }
2,bento
元素選擇器???????? 語法:標(biāo)簽名 { }
3,#fancy
ID選擇器???????????? 語法:#id內(nèi)容 { }??????????
4,plate apple
復(fù)合選擇器(交集選擇器)????? 語法:選擇器1 選擇器2???????? (相當(dāng)于嵌套,選擇? 語法1 下面的 語法2)
5,#fancy pickle
屬于:復(fù)合選擇器(交集選擇器)????? 語法:選擇器1 選擇器2?? (#id內(nèi)容 選擇器2)
6,.small
類選擇器???????????? 語法:.className { }
7,##orange.small 或 bento orange.small,plate .small
屬于:復(fù)合選擇器(交集選擇器)????? 語法:選擇器1選擇器2?? (選擇器)
8,bento orange.small
群組選擇器(并集選擇器)?????????? 語法:選擇器1,選擇器2,選擇器3 { }
9,plate,bento
##元素選擇器??
10,*
通用選擇器??????????語法:*{ }
11,plate *
通用選擇器??????????語法:*{ }
12,plate:first-of-type+ .small,plate:last-of-type+ apple
兄弟選擇器???????????? 語法:??? 1,查找后邊一個(gè)兄弟元素??? 兄弟元素 + 兄弟元素{}
13,bento~pickle
兄弟選擇器???????????? 語法:??? 2,查找后邊所有的兄弟元素??? 兄弟元素 ~ 兄弟元素{}
14,plate>apple
子元素選擇器?????語法:父元素 > 子元素{}
15,plate:last-of-type :first-child
子元素選擇器? - 選擇最后一個(gè)子標(biāo)簽?????????? 語法: ? ? ? :last-child???
16,plate:first-of-type apple,plate:nth-of-type(2) .small
###子元素選擇器?????????? 語法: ? ? ? :first-child??? - 選擇第一個(gè)子標(biāo)簽 ? ? ? ?:first-of-type??? - 第一個(gè)類型????? :nth-of-type - 指定的位置
17,plate:first-of-type .small,pickle.small
? :first-child??? - 選擇第一個(gè)子標(biāo)簽 ? ?? 與??? ### 的連用、
18,plate:nth-of-type(3)
19,bento:nth-last-child(4)
20,apple:first-of-type
21.plate:nth-of-type(even)
22.plate:nth-of-type(3),plate:nth-of-type(5)
23,plate:nth-of-type(2) .small
24,orange:last-of-type,apple:last-of-type
25,bento:not(bento:nth-of-type(2))
26,apple:not(apple:first-of-type.small)