background-attachment determines the tiling context and scroll state of a background image.
scroll − A background image set to scroll will scroll along with the rest of the document.
fixed − A background image set to fixed will remain locked in place while the rest of the document scrolls.
All the HTML elements.
object.style.backgroundAttachment = scroll | fixed;
<html> <head> </head> <body> <p style = "background-image:url(/images/logo.png); background-attachment:scroll; background-attachment:scroll; background-repeat: no-repeat; background-attachment: fixed;"> This parapgraph has scrolling background image. This parapgraph has fixed repeated background image. This parapgraph has fixed repeated background image. This parapgraph has fixed repeated background image. This parapgraph has fixed repeated background image. This parapgraph has fixed repeated background image. </p> </body> </html>
It will produce the following result −