How do you stretch a background image? I only want to stretch the width of my background image. Any help is appreciated.
Thanks!
How do you stretch a background image? I only want to stretch the width of my background image. Any help is appreciated.
Thanks!
As far as I know, there is no way to do this using CSS, which is what I believe you are using to display this background. The only option that is given is to repeat the background until it fills the screen (in x, y, or both).
Stretching may not be the best option, considering there are some very wide screen high resolution monitors out there that could double the width of your image and distort it a lot. The maximum I found for a monitor width is 2560px. If your image can't stretch a normal 1024px you have to stretch it 1.5 times it's normal width.
Last edited by garrettroyce; 03-28-2009 at 09:48 PM.
gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer
That is a viable solution I should have mentioned, but I personally try to avoid dependency on the z-index and floating. Not to mention there's still the problem of stretching an image 150%. All in all, I'd say a website using this technique would only look correct to 75% of the users viewing it.
gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer