Page 1 of 1

Image Positioning

Posted: Wed Jan 22, 2003 1:23 pm
by Gen-ik
I'm using CSS to add backgrounds to some TABLEs and TDs and know that they can be positioned using background-position: 100px 20px; etc.

My questions is can a background image be positioned relative to the documents top-left position?

It's a bit tricky to give an example :? but let's say that I want a background-image beind this message. Instead of having it's position relative to the top-left of this TD (which will be behind I'm using CSS), the image is positioned relative to the top-left of the document (which will be just above and to the left of PHP News somewhere).


Any help would be great on this one! :)

Posted: Wed Jan 22, 2003 3:58 pm
by Rob the R
It can, but you must apply the "background-position" style to the BODY element instead of the TD element. You could try specifying negative pixels, but that doesn't seem like a good idea to me ,since you'd need to know where the TD element is relative to the page.

Posted: Wed Jan 22, 2003 4:56 pm
by Gen-ik
Hmmm. I understand what you mean. It will take a bit of re-laying out of some page elements but as I'm still working on the first page this shouldn't be too much of a problem... I hope!

Thanks for the suggestion. :)