Page 58 - CSS
P. 58
body {
background-image: url('image.jpg');
background-attachment: scroll;
}
background-attachment: fixed
The background image will be fixed and will not move when the body is scrolled:
body {
background-image: url('image.jpg');
background-attachment: fixed;
}
background-attachment: local
The background image of the div will scroll when the contents of the div is scrolled.
div {
background-image: url('image.jpg');
background-attachment: local;
}
Background Repeat
The background-repeat property sets if/how a background image will be repeated.
By default, a background-image is repeated both vertically and horizontally.
div {
background-image: url("img.jpg");
background-repeat: repeat-y;
}
Here's how a background-repeat: repeat-y looks like:
https://riptutorial.com/ 36

