HTML background--repeat 属性

就是横向重复还是纵向重复。
假设你的页面有1004 X 700 px,但你的背景图片只有10 X 10px,如果不指定repeat属性,就会平铺,就是一张张重复的贴满你的背景。如果你只指定了-x,就是横向重复,那么它就会横着铺满,但不会纵向重复。-y则反之。明白?


background-repeat版本:CSS1  兼容性:IE4+ NS4+ 继承性:无


语法:

background-repeat : repeat | no-repeat | repeat-x | repeat-y

参数:

repeat :  背景图像在纵向和横向上平铺
no-repeat :  背景图像不平铺
repeat-x :  背景图像在横向上平铺
repeat-y :  背景图像在纵向平铺

说明:

设置或检索对象的背景图像是否及如何铺排。必须先指定对象的背景图像。
对应的脚本特性为backgroundRepeat。

示例:

menu { background: url("images/aardvark.gif"); background-repeat: repeat-y; }
p { background: url("images/aardvark.gif"); background-repeat: no-repeat; }
posted @ 2009-06-30 11:11  ThirdEye  阅读(726)  评论(0编辑  收藏  举报