homepage Welcome to WebmasterWorld Guest from 54.234.225.23
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
CSS: Need to background autofit to screen resolution
bonkerspr




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

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




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

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...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved