BG image

liunx

Guest
How do you make it so that there is an image in the background but it DOES NOT REPEAT?<!--content-->This is an IE (and Netscape 6) only method of having a "no-tile" background.<br />
Because it uses no-repeat image won't scroll with the page.<br />
Just like the effect of BGPROPERTIES="fixed"<br />
<br />
<HTML><br />
<HEAD><br />
<TITLE> Fixed background using styles <TITLE><br />
<STYLE TYPE="text/css"><br />
BODY { background-repeat:no-repeat;background-attachment:fixed;<br />
background-position:left top;background-image:url(blah.jpg) }<br />
</STYLE><br />
</HEAD><br />
<BODY><br />
etc...<br />
<br />
The background-position can left/center/right for x axis and<br />
top/center/bottom for the y axis. With IE5.5 you can use a numeric value to <br />
specify the x/y co-ordinates in pixels <br />
<br />
===================================================== <br />
<br />
cross-browser ???<br />
<br />
<HTML><br />
<HEAD><br />
<STYLE TYPE="text/css"><br />
#bgID { position:absolute;top:xxx;left:yyy;z-index:1 }<br />
</STYLE><br />
</HEAD><br />
<BODY><br />
<!-- page stuff --><br />
<br />
<DIV ID="bgID"><br />
<IMG SRC=http://www.htmlforums.com/archive/index.php/"blah.jpg"><br />
</DIV><br />
</BODY> <br />
</HTML><br />
<br />
The z-index value can be a problem. Netscape does not accept a<br />
negative value so other elements must be 2 or higher.<br />
<br />
This is only for a fixed window size and resolution. It would<br />
take scripting to make it dynamic.<!--content-->
 
Back
Top