PDA

View Full Version : HTML trick?


ATOMICsizePENCIL
May 6th, 2003, 03:28 PM
hey this can be real easy, or it can get rough. easiest way to solve the issue at hand...is to simply provide the appropriate information. PROMPTLY.

oh..guess i should tell y'all what the question is...spare some lives that way..

I want the code for basic HTML that will let me set the background wallpaper so that it fits the window, and resizes as the window resizes. simply put, i have an image, that i dont want tiled, i want it to 'stretch' over the window. Text should be able to scroll withought the BG moving.
IVE SEEN IT DONE. I DID IT IN HIGH SCHOOL (but i was high, so i canno remember howi dunnit)

sigh

i know it can be done *sobs*

Tanika
May 6th, 2003, 04:14 PM
<BODY BACKGROUND="image name" BGPROPERTIES="FIXED">



:D

franz
May 6th, 2003, 05:17 PM
Originally posted by Tanika
<BODY BACKGROUND="image name" BGPROPERTIES="FIXED">
Uhm, no.. 'bgproperties' is an ugly IE oddity, not valid markup. If you want to have a fixed background you'll want to use the 'background-attachment' CSS property.. that is not what he wants though (stretching)

franz
May 6th, 2003, 05:32 PM
Originally posted by wazzo
I want the code for basic HTML that will let me set the background wallpaper so that it fits the window, and resizes as the window resizes.
Basic HTML? Impossible.

You could do something like this.. works on CSS2-enabled, non-crappy browsers only:

Quick hack:


<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
#bg {
position: fixed;
top: 0px;
z-order: 1;
width:100%; height:100%;
}
#front {
position: absolute;
z-order: 2;
left:0px;
top:0px;
}
</style>
</head>
<body>
<img src='image.jpg' id='bg' />
<div id='front'>content</div>
</body>
</html>