[list]
[*]CSS background-repeat 属性
[/list]
[url href="http://www.w3school.com.cn/css/css_reference.asp"]参考手册[/url]
[list]
[定义和用法
background-repeat 属性设置是否及如何重复背景图像。
默认地,背景图像在水平和垂直方向上重复。
详细说明
background-repeat 属性定义了图像的平铺模式。
从原图像开始重复,原图像由 background-image 定义,并根据 background-position 的值放置。]
[/list]
[浏览器支持
所有浏览器都支持 background-repeat 属性。
注释:任何版本的 Internet Explorer (包括 IE8)都不支持属性值 "inherit"。
][list]
[背景定位
可以利用 background-position 属性改变图像在背景中的位置。
下面的例子在 body 元素中将一个背景图像居中放置:]
[/list]
[list]
[*]可用的值
[*]值 描述
[*]repeat 默认。背景图像将在垂直方向和水平方向重复。
[*]repeat-x 背景图像将在水平方向重复。
[*]repeat-y 背景图像将在垂直方向重复。
[*]no-repeat 背景图像将仅显示一次。
[*]inherit 规定应该从父元素继承 background-repeat 属性的设置。
[/list]
连接
http://www.w3school.com.cn/css/pr_background-repeat.asp
[*]CSS background-repeat 属性
[/list]
[url href="http://www.w3school.com.cn/css/css_reference.asp"]参考手册[/url]
[list]
[定义和用法
background-repeat 属性设置是否及如何重复背景图像。
默认地,背景图像在水平和垂直方向上重复。
详细说明
background-repeat 属性定义了图像的平铺模式。
从原图像开始重复,原图像由 background-image 定义,并根据 background-position 的值放置。]
[/list]
实例
body
{
background-image: url(stars.gif);
background-repeat: repeat-y;
}
[list]
[浏览器支持
所有浏览器都支持 background-repeat 属性。
注释:任何版本的 Internet Explorer (包括 IE8)都不支持属性值 "inherit"。
][list]
[背景定位
可以利用 background-position 属性改变图像在背景中的位置。
下面的例子在 body 元素中将一个背景图像居中放置:]
[/list]
提示和注释
提示:背景图像的位置是根据 background-position 属性设置的。如果未规定 background-position 属性,图像会被放置在元素的左上角。
[list]
[*]可用的值
[*]值 描述
[*]repeat 默认。背景图像将在垂直方向和水平方向重复。
[*]repeat-x 背景图像将在水平方向重复。
[*]repeat-y 背景图像将在垂直方向重复。
[*]no-repeat 背景图像将仅显示一次。
[*]inherit 规定应该从父元素继承 background-repeat 属性的设置。
[/list]
连接
http://www.w3school.com.cn/css/pr_background-repeat.asp