Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: background image


Message #1 by KATHLEEN.M.WHALEN@c... on Thu, 17 May 2001 13:45:43 -0400
Hi Kathleen,

This depends on the browser you are targetting. For instance, NN 4.x will 
always tile the background image in both directions. To create the 
impression that the image only appears once, create lots of whitespace 
around (to the right of it). Make sure you add at least 1200 or more 
pixels, so even browsers with ridiculous high res screens will still only 
see the image once.

In IE and NN6 you can set CSS properties for the background image, like 
background attachment, repeat and position.

Try something like this:

BODY
{
	background-attachment : scroll;
	background-image : url(http://www.somesite.com/images/bg.gif)
	background-repeat : no-repeat;
}

This will create a background image that is not repeated. It will scroll 
with the text.
Other options are:

attachment: fixed / scroll / 
repeat: repeat-x / repeat-y (to repeat on only on direction) and repeat


Hope this helps,

Imar



> I have a background image that I would like to use as a watermark on a 
> page.  I only want it to appear once.  on the page.
> What is the best way to handle this?

  Return to Index