View Full Version : How to keep background stationary

07-05-2007, 07:22 AM
While looking around in this forum, I found some web pages with a stationary background and the web page itself can move up and down with the scroll bar... What is the trick to this?
Or direct me to a sticky


Tom vR
07-05-2007, 07:31 AM
Experiment with I-Frames.. Here is the link.
Menubar in I-frame (http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/4528-menubar-i-frame.html)

07-05-2007, 08:21 AM
Hi, try pasting this code below into the “Beginning of Body” in your page properties & replace my url image link with your own.

<script language="JavaScript1.2">
if (document.all||document.getElementById)
document.body.style.background="url('http://www.collectors-info.com/Collector-bird-jackdoor.gif') white center no-repeat fixed"


Good luck.

Tom vR
07-05-2007, 11:15 AM
Hi Chris,

Where can I see the effect of this code on your website? I went to your site, but cannot see where you have used it. The code seems very intersting. Many thanks.

07-05-2007, 03:41 PM
Hi Tom, I need to check this script? It seems to be fine in Fire fox, but wont center on my machine using IE. Maybe you can confer if this is right on this link. http://www.collectors-info.com/testing/static-background-image-on-scroll.html
The text should be dead center of screen.
I have been having a few browser issues lately so it maybe just my machine.

But if its ok on yours? Just follow the instructions above & then put text on the page as normal & you will see the effect. Remember to make the page about 1000 long so you have some scroll & place the text down at the 900 mark to see how it works as a test.

Tom vR
07-05-2007, 06:53 PM
Thanks Chris, it works perfectly. Is there a way that you can make the header area stationary while you can scroll for the rest of the page using code? You can achive this using iframes, but is there another way?

07-05-2007, 09:05 PM
Yes you can! But only with iframes as a simple way with BV. Or at this link. http://www.dynamicdrive.com/style/layouts/category/C11 This will involve starting on the HTML/CSS lessons. Lol. One day I might try.

This is also set up as self expanding page lengths.

07-06-2007, 03:54 AM
Be very careful about using iframes if you want to make sure all people will see it correctly - and if you want to be sure that the se's will read it correctly as from the page it's on.

They have uses - as images do - but for most of your text, it's still not the best way to go.