Click to See Complete Forum and Search --> : How do I get the background of a page to stay still?


OM2
03-15-2007, 06:50 PM
Can someone remind me how I get the background of a page to stay still?
i.e. which you can scroll up and down the contents.

Thanks.


OM

WebJoel
03-15-2007, 07:08 PM
<body style="background:url(picture.jpg) 50% 50% fixed;">

Something like this I think. This should 'center' the image at 50% from top and left, and "fixed" removes it from scrolling.

OM2
03-15-2007, 07:35 PM
tried it.
doesn't work. :(

Centauri
03-15-2007, 08:11 PM
Must be doing something wrong - this method works fine for me. Can you post the code you tried to use?

tca
03-15-2007, 08:23 PM
http://www.w3schools.com/css/tryit.asp?filename=trycss_background

WebJoel
03-16-2007, 08:19 AM
<style>
body { background:#ffffff url(untitled.gif) no-repeat fixed center center;}
</style>
(above goes before "</head>")


It shouldn't matter if the declarations are not in 'a certain order', but this works and is a bit fuller than the example I gave last night.