...

View Full Version : How to vertically strech a background image?



JAVAEOC
07-20-2005, 08:26 PM
How to vertically strech a background image?

than ks in advnaced

chump2877
07-20-2005, 08:32 PM
Why would you want to do this with your HTML? I would use Photoshop or a design program to stretch my image and then make it my background....

_Aerospace_Eng_
07-20-2005, 08:38 PM
You can't, you would have to make it repeat or do what chump said.

JAVAEOC
07-22-2005, 02:42 AM
I wanted it so it fits all resolutions :(

_Aerospace_Eng_
07-22-2005, 02:56 AM
The most you can do is have it centered and have a background color that matches a dominant color in the image to make it appear like its resizing.

<style type="text/css">
body {
background-image:url(yourimage.jpg);
background-position:center;
background-repeat:no-repeat;
background-attachment:fixed;
background-color:#000000 /*this should match a dominant color in your image*/
}
</style>
The shorthand version of that would be

<style type="text/css">
body {
background:#000000 url(yourimage.jpg) no-repeat fixed center;
}
</style>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum