CSS background-attachment Property

CSS background attachment property specifies whether the image set using background-image property is fixed with respect to the containing block or shall it scroll

There are two different views to think about when talking about background-attachment: the main view (browser window), and the local view (you can see this in the demo above).


background-attachment: scroll|fixed|local|initial|inherit;

scroll: It sets the background image to get fixed at its position with respect to the containing element and scroll with the page. It is the default value.

Example -