CSS背景屬性
CSS背景元素允許你控制元素的背景顏色,將圖像設(shè)置為背景,垂直或水平低重復(fù)背景圖像,并且在網(wǎng)頁上定位背景圖像。
瀏覽器支持:IE: Internet Explorer, F: Firefox, N: Netscape。
W3C:“W3C”列的數(shù)字顯示出屬性背景由哪個CSS標(biāo)準(zhǔn)定義(CSS1還是CSS2)。
屬性 |
描述 |
值 |
IE |
F |
N |
W3C |
background |
簡寫屬性,作用是將背景屬性設(shè)置在一個聲明中。 |
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
|
4 |
1 |
6 |
1 |
background-attachment |
設(shè)置是否背景圖像是固定的或雖頁面其余部分滾動。 |
scroll
fixed
|
4 |
1 |
6 |
1 |
background-color |
設(shè)置元素的背景顏色。 |
- color-rgb
- color-hex
- color-name
- transparent
|
4 |
1 |
4 |
1 |
background-image |
將圖像設(shè)置為背景。 |
|
4 |
1 |
4 |
1 |
background-position |
設(shè)置背景圖像的起始位置。 |
- top left
- top center
- top right
- center left
- center center
- center right
- bottom left
- bottom center
- bottom right
- x-% y-%
- x-pos y-pos
|
4 |
1 |
6 |
1 |
background-repeat |
設(shè)置背景圖像是否及如何重復(fù)。 |
- repeat
- repeat-x
- repeat-y
- no-repea
|
|