Page 1 of 1

Background Auto Resize to window

Posted: Sat 03 Dec 2011 4:30 am
by Darknstormy
Hey all you HTML gurus

Can we have a background on our webpages that will resize its self to the window size?

so say I jump on my laptop 1920 * 1080 and the picture will fit

and if I jump on my dads desktop 1280 x 1024 can we make it auto resize..


cheers

Re: Background Auto Resize to window

Posted: Sat 03 Dec 2011 4:42 am
by beteljuice
Simple answer - No :lol:

... but you really shouldn't be thinking of using images that big anyway.

But then I remember (very) slow modems :roll:

Re: Background Auto Resize to window

Posted: Sat 03 Dec 2011 4:49 am
by Darknstormy
I thought so, but I thought I would ask :D

Thanks mate..

Re: Background Auto Resize to window

Posted: Sat 03 Dec 2011 5:27 am
by beteljuice
Hmmm ....... the beteljuice inadvertently lied !

According to CSS3 standards you can use the 'style'

background:url(img_flwr.gif);
background-size:100% 100%;

... and that fills the 'container' with the image (NOT IE8)

Re: Background Auto Resize to window

Posted: Sat 03 Dec 2011 11:20 am
by Darknstormy
IT WORKS!!!


Your a champion!!

Re: Background Auto Resize to window

Posted: Sat 03 Dec 2011 3:32 pm
by beteljuice
Only thing is it will 'distort' the picture to fit the window size. I for one, rarely run anything fullscreen, and of course if you 'design' for a wide screen it will be squashed for an old 5/4 format and what would it look like vertically on a tablet ?

I think I'll mostly be leaving that one alone :?