# 使用css滾動期間保持背景圖像固定

This is going to be rather silly of me asking, but how do I keep the background image fixed during a page scroll. I have this CSS code, and the image is a background of the body and not <div></div>

    body{
background-position:center;
background-image:url(../images/images5.jpg);
}


## 最佳答案

background-attachment: fixed;


http://www.w3.org/TR/CSS21/colors.html ＃背景的屬性