Click to See Complete Forum and Search --> : How do I Auto resize my body background to current view?


Jeffrey_Mason
11-21-2003, 04:59 PM
Basically I am trying to get my body background to resize to the current view the browser is in.

It currently produces multiple versions of the image instead of stretching the original to fit to page.

The image is just a radial color swatch created in Photoshop so the quality of the image being stretched out is not such a big deal.

Any help is most appreciated.

Thanks,
Jeffrey

Phil Karras
11-21-2003, 05:45 PM
It's rather interesting, "background" has actually been deprecated, meaning it is no longer recommended to use it, you should use something else. Yet the book I have doesn't say what to use.

My guess is to look into CSS and see if there's a way to do what you want to do with that.

I believe that this is an HTML/CSS question not a JavaScript question. Try there & see if anyone there knows better. It might become a JS question if you really need to use JS to change a CSS background size I guess. But, first see if you can find a CSS way to do a page body background.

Good-luck & let us know what you find.

Jeffrey_Mason
11-21-2003, 07:05 PM
I have tried using a CSS and the problem is still there.

I will make a post in the CSS section and see if there is anyone that has an idea there.

I found a sloppy workaround to the problem by taking a custom swatch that is 2000X1200 and using that as the background image, however, since the quality of the file will not be in question with the "stretching" of the bgi, I am always worried about file sizes and such and to use a 2000X1200 image when a 320X180 image would do just fine is really what I am after.

What starts sloppy surely ends sloppy :)

Thanks for the reply,
Jeffrey