CSS background属性
- background-color:背景颜色 #fff
- background-image:背景图片
实例:background-image:url(‘paper.gif’); - background-repeat:是否平铺
repeat 背景图像将向垂直和水平方向重复。这是默认
repeat-x 只有水平位置会重复背景图像
repeat-y 只有垂直位置会重复背景图像
no-repeat background-image不会重复
inherit 指定background-repea属性设置应该从父元素继承 - background-attachment:
scroll 背景图片随页面的其余部分滚动。这是默认
fixed 背景图像是固定的 - background-position:
left top
left center
left bottom
right top
right center
right bottom
center top
center center
center bottom - background:
.
CSS3 background属性:
可以给不同的图片设置多个不同的属性,中显示在最顶端的为第一张
#example1 {
background: url(img_flwr.gif) right bottom no-repeat, url(paper.gif) left top repeat;
padding: 15px;
}
background-size属性:可以改变图片的大小
background-Origin:background-Origin属性指定了背景图像的位置区域。
content-box, padding-box,和 border-box区域内可以放置背景图像
background-clip属性:
CSS3中background-clip背景剪裁属性是从指定位置开始绘制