View Full Version : Watermark background image

06-04-2005, 02:36 AM
Using this script



I have successfully used this script on a simple page, and now want to use it inside a table but can't.

What i want to achieve is a fixed position background image inside the centre column of a table behind text.

What I get is the image on the page BEHIND the table so it won't show!

The situation is complicated by using SSI ingredients. Each pages has 4 elements:


text.shtml calls the other three elements into the correct positions.

I have tried including the script inside both text.shtml and text.htm, but it always ends up as PAGE background not table background. I'm probably missing something pretty simple, but I'm new to this game :-)

here's the script

<script language="JavaScript1.2">

Watermark Backgound Image Script- Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS,
visit dynamicdrive.com

if (document.all||document.getElementById)
document.body.style.background="url('notebook.jpg') white center no-repeat fixed"




06-04-2005, 04:34 AM
What browser are you using? Does your page have a doctype? Be aware that fixed backgrounds work only for the body in IE, other browsers allow them for things like tables.

06-04-2005, 10:50 PM
I am using IE, but have no doctype set. Sounds like maybe just can't use inside a table :-(

06-04-2005, 11:03 PM
You should still be able to use a standard background for the table ex:

<table style="background:url('some.jpg') no-repeat center">

06-07-2005, 05:10 AM
Thanks John -- standard backgrounds aren't the problem. It would be good to get the static watermark script working one day.