homepage Welcome to WebmasterWorld Guest from 54.145.182.50
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
CSS: Need to background autofit to screen resolution
bonkerspr

5+ Year Member



 
Msg#: 3973377 posted 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

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



 
Msg#: 3973377 posted 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