wibumba
12-24-2005, 05:19 AM
How do you resize a background image to fit the window without editing the image itself? I would do the <img="pic.bmp" height="100" width="12323"
script, but I thought there was a way to have the background just stretch instead of tile.
jscheuer1
12-24-2005, 05:44 AM
As far as I know, this is not possible. As a practical matter, the size and resolution of an image to cover the entire background of a very large display - say 2048x1536, would look very poor when resized by the browser to 800x600 resolution. I suppose that given the right sort of image it could possibly be made to work out, using a middle sized version that is either expanded or contracted depending upon the user's resolution. This cannot be done, as a true background, I don't think. If one were to make an absolutely positioned division with a low z-index that covered the window available dimensions and put an image in there and dynamically resized said image to the window dimensions perhaps but, then all of the rest of your content would need to have a higher z-index to appear over this 'background'. This requires that all the content be either absolutely or relatively positioned - not the best way to design a page. Even so, window dimensions will often be out of sync with the proportional dimensions of any particular image. These facts are why there is no straightforward way to do this using the background properties of a window. It is also why x/y position, left, right, top, bottom, center, repeat, no-repeat and fixed are options.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.