Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

CSS: Need to background autofit to screen resolution



1:29 pm on Aug 17, 2009 (gmt 0)

5+ Year Member

I have a background for my website, i am trying to to make a CSS code for the background auto adjust to any screen resolution. i have this on my CSS:
#background {
width: 100%;
height: 100%;
background-image: url('bg1.jpg');
background-repeat: no-repeat;
position: absolute;
left: 0px;
top: 0px;
.stretch {

and this on my HTML index file:
<body style="background-image: url('bg1.jpg'); background-color: #000000;" class="stretch" id="background">

but it dont works, anyone can help me?


3:54 pm on Aug 17, 2009 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You cannot resize background images with CSS2.1

CSS3 will have some features to do some of it but don't expect all browsers to support it yet (and that's an understatement I'm afraid, as you should not expect anything from IE, not even version 8)



Featured Threads

Hot Threads This Week

Hot Threads This Month