18910140161

css之BackGround属性介绍 - asdsd

顺晟科技

2022-09-13 12:13:07

57

1CSS之Background属性介绍2006-08-2300:35background可以定义的内容:
2background:background-color||background-image||background-repeat||background-attachment||background-position
3-------------------------
4background-color:transparent|color
5参数:
6transparent:背景色透明
7color:指定颜色。
8----------------------------------
9background-image:none|url(url)
10参数:
11none:无背景图
12url:使用绝对或相对地址指定背景图像
13-------------------------------
14background-repeat:repeat|no-repeat|repeat-x|repeat-y
15参数:
16repeat:背景图像在纵向和横向上平铺
17no-repeat:背景图像不平铺
18repeat-x:背景图像在横向上平铺
19repeat-y:背景图像在纵向平铺
20说明:
21设置或检索对象的背景图像是否及如何铺排。必须先指定对象的背景图像。
22对应的脚本特性为backgroundRepeat。
23----------------------------
24background-attachment:scroll|fixed
25参数:
26scroll: 背景图像是随对象内容滚动
27fixed: 背景图像固定
28-------------------------------
29background-position:length||length
30background-position:position||position
31参数:
32length:百分数|由浮点数字和单位标识符组成的长度值。
33position:top|center|bottom|left|center|right
34说明:
35设置或检索对象的背景图像位置。必须先指定background-image属性。默认值为:(0%0%)。
36如果只指定了一个值,该值将用于横坐标。纵坐标将默认为50%。第二个值将用于纵坐标。
37该属性定位不受对象的补丁属性(padding)设置影响。
38对应的脚本特性为backgroundPosition。
39
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航