Background Attachment Example


background-attachment: scroll causes the elements background to be fixed to the page, so that it scrolls when the page is scrolled. If the element content is srcolled, the background does not move.


    

background-attachment: fixed causes an elements background to be fixed to the viewport, so that it does not scroll when the page or element content is scrolled. It will always remain in the same position on the screen.


    

background-attachment: local, causes an elements background to be fixed to the actual element itself. When the page is scrolled, the elements background will move along with it, if the element does so also. When the elements content is scrolled, the background will scroll along with it.