background-attachment -- 定義背景圖片隨滾動軸的移動方式
- 取值: scroll | fixed | inherit
- scroll: 隨着頁面的滾動軸背景圖片將移動
- fixed: 隨着頁面的滾動軸背景圖片不會移動
- inherit: 繼承
- 引用網址:http://www.dreamdu.com/css/property_background-attachment/
- 初始值: scroll
- 繼承性: 否
- 適用於: 所有元素
- background:背景.attachment:附着.
示例
body
{
background-image
:
url('list-orange.png')
;
background-attachment
:
fixed
;
background-repeat
:
repeat-x
;
background-position
:
center center
;
}
屏幕的背景圖片爲一條橙色線.隨着滾動軸移動,橙色線的視覺位置不變.