■ 定义
background-repeat属性用于定义是否及如何对背景图像进行平铺
■ 使用说明
语法:
background-image: repeat | no-repeat | repeat-x | repeat-y ;
属性值:
repeat:沿着x轴和y轴平铺(默认)
no-repeat:不平铺
repeat-x:沿着x轴平铺
repeat-y:沿着y轴平铺
背景平铺可以添加背景颜色,只不过背景图片会压住背景颜色
■ 示例
div {
width: 100px;
height: 100px;
background-image: url(images/logo.png);
background-repeat: no-repeat;
}
本文介绍了CSS中background-repeat属性的使用方法,包括如何沿不同轴进行背景图像的平铺,以及如何禁止背景图像的重复显示。此外还提供了一个具体的样式设置示例。
330

被折叠的 条评论
为什么被折叠?



