PDA

View Full Version : Background Wallpaper - fit to screen?


jxm28788
04-Dec-2010, 08:57 AM
How do I set the background image and get it to stretch to fit the page?

ie. I want one of those funky xmas image backgrounds that are on a lot of the big sites, but using the actinic background feature just tiles it. Messing with the css I can get it fixed in the top left with no repeat but that's no good unless I use an image that's so huge that it will fill every potential resolution that customers might be using...

What I really need is that strech effect that windows uses for the dekstop image... any ideas?

leehack
04-Dec-2010, 09:13 AM
Go with the large image option if a tiler is not possible, it will only result in a single download per visit, just optimise it accordingly.

completerookie
04-Dec-2010, 12:56 PM
go and lookat www.cssplay.co.uk - everything you need is there
kev

paul in london
26-Sep-2011, 12:30 PM
This worked most sucesfully for me, place it in the header section of the page and change the image filepath to suit your needs :)


<style type="text/css">
body {
background-image: url('background.jpg');background-attachment: fixed; background-repeat:no-repeat;
background-position:center center;
-o-background-size: 100% 100%, auto;
-moz-background-size: 100% 100%, auto;
-webkit-background-size: 100% 100%, auto;
background-size: 100% 100%, auto;}
}
</style>

- Suzy