第10章:颜色与背景

10.4 应用

10.4.1 灵活使用背景

设计 @ 制作

10.4.2 模拟边框

固定宽度和高度

联系方式

宽度固定高度不定方法1

background-image
值:<uri> | none | inherit
uri:图片的链接地址。
none:无图片。
background-repeat
值:repeat | repeat-x | repeat-y | no-repeat | inherit
repeat:背景图片在水平和垂直方向都重复显示。
repeat-x:背景图片只在水平方向重复显示。
repeat-y:背景图片只在垂直方向重复显示。
no-repeat:背景图片不重复,只显示1次。

宽度固定高度不定方法2

background-repeat
值:repeat | repeat-x | repeat-y | no-repeat | inherit
repeat:背景图片在水平和垂直方向都重复显示。
repeat-x:背景图片只在水平方向重复显示。
repeat-y:背景图片只在垂直方向重复显示。
no-repeat:背景图片不重复,只显示1次。
repeat:背景图片在水平和垂直方向都重复显示。
repeat-x:背景图片只在水平方向重复显示。
repeat-y:背景图片只在垂直方向重复显示。
no-repeat:背景图片不重复,只显示1次。
repeat:背景图片在水平和垂直方向都重复显示。
repeat-x:背景图片只在水平方向重复显示。
repeat-y:背景图片只在垂直方向重复显示。
no-repeat:背景图片不重复,只显示1次。

宽度和高度都不定

background-image
值:<uri> | none | inherit
uri:图片的链接地址。
none:无图片。
background-repeat
值:repeat | repeat-x | repeat-y | no-repeat | inherit
repeat:背景图片在水平和垂直方向都重复显示。
repeat-x:背景图片只在水平方向重复显示。
repeat-y:背景图片只在垂直方向重复显示。
no-repeat:背景图片不重复,只显示1次。

简单的链接背景替换

滑动门(全部浮动)

滑动门(清除浮动)

滑动门(:after伪元素清除浮动)

返回代码目录