今天我们将介绍一个用来学习CSS选择器的游戏 – CSS Diner(CSS晚餐),既可以学习CSS又可以娱乐,过程十分有趣。
在这个游戏中,你可以学习26个CSS选择器的用法(含CSS3),从简单到高级,比如子元素选择器、后代选择器、伪元素选择器等等,如果你玩完这个Css Diner,我想你对CSS的选择器已经了解差不多了。比如下面一起来看看如何玩法。
游戏链接:http://flukeout.github.io/
输入对应晃动物品的元素,物品飞走,你就过关成功
下面附上参考答案
- plate
- bento
- #fancy
- plate apple
- #fancy pickle
- .small
- orange.small
- bento orange.small
- bento,plate
- apple,plate orange,bento,bento orange,plate 或者 *
- #fancy orange,plate pickle,plate apple 或者 plate *
- plate + apple
- bento~pickle
- plate>apple
- orange:first-child
- plate apple,plate pickle
- .small:last-child
- :nth-child(3)
- bento:nth-last-child(3)
- apple:first-of-type
- plate:nth-of-type(even)
- plate:nth-of-type(2n+3)
- plate apple:only-of-type
- orange:last-of-type,apple:last-of-type
- bento:empty
- :not(.small,plate)
- [for]
- plate[for]
- bento[for="Vitaly"]
- [for^=S]
- [for$=to]
- [for*=bb]
好了答案在这里了,有什么清楚的朋友可以联系我或者留言。
网友评论