css 选择器练习

1,074 阅读2分钟

练习网址:flukeout.github.io/

餐厅练习链接 flukeout.github.io/

以下答案都是我自己边做边写的,如果有错误欢迎指出

第1题 Select the plates 答案:plate

第2题Select the bento boxes 答案:bento

第3题Select the fancy plate 答案:#fancy

第4题Select the apple on the plate 答案:plate apple

第5题Select the pickle on the fancy plate 答案:plate#fancy pickle

第6题Select the small apples 答案:apple.small

第7题Select the small oranges 答案:orange.small

第8题Select the small oranges in the bentos 答案:bento orange.small

第9题Select all the plates and bentos 答案:plate,bento

第10题Select all the things! 答案:*

第11题Select everything on a plate 答案:plate *

第12题Select every apple that’s next to a plate 答案:plate+apple

第13题Select the pickles beside the bento 答案:bento~pickle

第14题Select the apple directly on a plate 答案:plate>apple

第15题Select the top orange 答案:plate :first-child

第16题Select the apple and the pickle on the plates 答案:plate :only-child

第17题Select the small apple and the pickle 答案:apple:first-child,pickle:last-child

第18题Select the 3rd plate 答案:plate:nth-child(3)

第19题Select the 1st bento 答案:bento:nth-last-child(3) 或者 bento:nth-child(2)

第20题Select first apple 答案:apple:first-of-type

第21题Select all even plates 答案:plate:nth-child(even)

第22题Select every 2nd plate, starting from the 3rd 答案:plate:nth-of-type(2n+3)

第23题Select the apple on the middle plate 答案:plate apple:only-of-type

第24题Select the last apple and orange 答案:orange:last-of-type,apple:last-of-type

第25题Select the empty bentos 答案:bento:empty

第26题Select the big apples 答案:apple:not(.small)

第27题Select the items for someone 答案:[for]

第28题Select the plates for someone 答案:plate[for]

第29题Select Vitaly’s meal 答案:[for=Vitaly]

第30题Select the items for names that start with ‘Sa’ 答案:[for^=Sa]

第31题Select the items for names that end with ‘ato’ 答案:[for$=ato]

第32题Select the meals for names that contain ‘obb’ 答案:[for*=obb]

转载自:blog.csdn.net/weixin_4388…

作者:苏纪的安宁