How to make the background stationary?

B

Bruce W...1

I've seen number of websites where the background image doesn't move
when you scroll down the page. Just the content scrolls. How is this
done?

Thanks for your help.
 
R

Richard

Bruce said:
I've seen number of websites where the background image doesn't move
when you scroll down the page. Just the content scrolls. How is this
done?
Thanks for your help.

As CSS definition.

body{background:url("image.jpg") fixed no-repeat;
background-position:center;}

or

body {background-image:url("imagename.jpg");
background-attachment:fixed;
background-repeat:no-repeat;
background-position:center; }

URL will be the full path of the image within the ( ). Do not change "URL",
that is required as is.
Position can be "top left right bottom center" or combination of two.
"center" by itself places the image in the physical center of the page while
"top center" would place it at the top center of the page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top