- background-color:指定元素的背景色
- opacity 属性指定元素的不透明度/透明度。取值范围为 0.0 - 1.0。值越低,越透明(使用 opacity 属性为元素的背景添加透明度时,其所有子元素都继承相同的透明度,不希望对子元素应用不透明度使用 RGBA 颜色值)
- background-image:指定用作元素背景的图像(默认情况下,图像会重复,以覆盖整个元素)
-
.page{ background-image: url("tp1.gif"); }
-
- background-repeat:
- 仅在水平方向重复 :background-repeat: repeat-x;
- 垂直重复图像:background-repeat: repeat-y;
- 只显示一次背景图像:background-repeat: no-repeat;
- background-attachment:指定背景图像是应该滚动还是固定的(不会随页面的其余部分一起滚动)
-
//指定应该固定背景图像 .page{ background-image: url("tp1.png"); background-repeat: no-repeat; background-position: right top; background-attachment: fixed; }
-
- background-position:用于指定背景图像的位置
-
//把背景图片放在右上角 .page{ background-image: url("tp1.png"); background-repeat: no-repeat; background-position: right top; } //指定背景图像应随页面的其余部分一起滚动 .page{ background-image: url("tp1.png"); background-repeat: no-repeat; background-position: right top; background-attachment: scroll; }
-
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交