CSS是什么游戏?

html-css020

CSS是什么游戏?,第1张

CSS就是一种叫做样式表(stylesheet)的技术。也有的人称之为层叠样式表(Cascading Stylesheet)。 在主页制作时采用CSS技术,可以有效地对页面的布局、字体、颜色、背景和其它效果实现更加精确的控制。 只要对相应的代码做一些简单的修改,就可以改变同一页面的不同部分!

CSS提供了丰富的选择器类型,包括标记选择器、类选择器、id选择器、伪类选择器及属性选择器等。

CSS Dinner是一个辅助学习CSS选择器的小游戏,这次借助这个游戏结合实际操作,希望对CSS选择器能更好掌握。

接下来开始have CSS dinner!

答案: plate

答案: bento

答案: #fancy

答案: plate apple

答案: #fancy pickle

答案: .small

答案: orange.small

答案: bento orange.small

答案: bento,plate

答案: *

答案: plate *

答案: plate+apple

答案: bento~pickle

答案: plate>apple

答案: plate orange:first-child

答案: plate *:only-child

答案: #fancy apple:last-child, :last-child

注意:选择pickle的选择器“:last-child”前有空格,表示父元素为最外层的“table”。

答案: :nth-child(3)

注意::nth(3)选择的是最后一个盘子(没有-child),即fancy plate。

答案: bento:nth-last-child(3)

答案: apple:first-of-type

答案: nth-of-type(even)

答案: nth-of-type(2n+3)

答案: apple:only-of-type

答案: orange:last-of-type,apple:last-of-type

答案: bento:empty

答案: apple:not(small)

答案: [for]

答案: plate[for]

答案: [for=Vitaly]

答案: [for^="Sa"]

答案: [for$="ato"]

答案: [for*="obb"]