Home | Computer Science

<
CSS background-attachment

Defination

The background-attachment property specifies whether the background image should scroll or be fixed.


BACKGROUND ATTACHMENT Syntax of background attachment is
body {
background-image: url("Helloworld.jpg");
background-attachment: fixed;
}
There are two types of Attachments
For eg: Program
INPUT

<!DOCTYPE html> <html> <head> <style> body { background-image: url("World.jpg"); background-position: right top; background-attachment: fixed; } </style> </head> <body> <h1>BACKGROUND-ATTACHMENT</h1> <p>Now you can see we have scrolled the page but image noy moved with it X50</p> </body> </html>.

OUTPUT