The background-attachment
property specifies whether the background image should scroll or be fixed (will not scroll with the rest of the page):
Specify that the background image should be fixed:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
Try it Yourself »
Specify that the background image should scroll with the rest of the page:
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: scroll;
}
Try it Yourself »
Property | Description |
---|---|
background-attachment | Sets whether a background image is fixed or scrolls with the rest of the page |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!