1

CSS之Background属性介绍2006-08-2300:35background可以定义的内容:
2

background:background-color||background-image||background-repeat||background-attachment||background-position
3

-------------------------
4

background-color:transparent|color
5

参数:
6

transparent:背景色透明
7

color:指定颜色。
8

----------------------------------
9

background-image:none|url(url)
10

参数:
11

none:无背景图
12

url:使用绝对或相对地址指定背景图像
13

-------------------------------
14

background-repeat:repeat|no-repeat|repeat-x|repeat-y
15

参数:
16

repeat:背景图像在纵向和横向上平铺
17

no-repeat:背景图像不平铺
18

repeat-x:背景图像在横向上平铺
19

repeat-y:背景图像在纵向平铺
20

说明:
21

设置或检索对象的背景图像是否及如何铺排。必须先指定对象的背景图像。
22

对应的脚本特性为backgroundRepeat。
23

----------------------------
24

background-attachment:scroll|fixed
25

参数:
26

scroll: 背景图像是随对象内容滚动
27

fixed: 背景图像固定
28

-------------------------------
29

background-position:length||length
30

background-position:position||position
31

参数:
32

length:百分数|由浮点数字和单位标识符组成的长度值。
33

position:top|center|bottom|left|center|right
34

说明:
35

设置或检索对象的背景图像位置。必须先指定background-image属性。默认值为:(0%0%)。
36

如果只指定了一个值,该值将用于横坐标。纵坐标将默认为50%。第二个值将用于纵坐标。
37

该属性定位不受对象的补丁属性(padding)设置影响。
38

对应的脚本特性为backgroundPosition。
39