Welcome to WebmasterWorld Guest from 107.21.159.218

Forum Moderators: not2easy

Message Too Old, No Replies

CSS: Need to background autofit to screen resolution

     

bonkerspr

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;
z-index:0;
}
.stretch {
width:100%;
}

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?

swa66

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)

[w3.org...]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month