Stretching background image
AnonymousDecember 23, 2011 at 7:39 pm #2726
Is it possible to have a background image to stretch to 100% width/height of the user’s screen resolution?Mod
If you go to my main website (which is so beta it’s still alpha): http://www.kjodle.net
you can choose various stylesheets. Some of them (like Night Sky) use full-size background images. I stretch them out using this code:
background-size: 100% 100%, auto;
-o-background-size: 100% 100%, auto;
-moz-background-size: 100% 100%, auto;
-webkit-background-size: 100% 100%, auto;
This works really well. Keep in mind that if somebody has a really wide monitor, the images can appear distorted.
Also, keep in mind that this doesn’t work in typewriters, toasters, or IE6.Mod
I may have left out the most important part: that code goes with the
bodyin the style sheet.
I don’t think this works in IE7, either. (Interestingly, the latest version of Safari doesn’t handle the theme switcher at all, so +1 to IE on that score.)
You must be logged in to reply to this topic.