Return to Snippet

Revision: 48645
at July 7, 2011 01:09 by neoline


Initial Code
/* Use this markup: */

<div id="background">
    <img src="img.jpg" class="stretch" alt="" />
</div>

*/ with the following css: */

#background {
    width: 100%; 
    height: 100%; 
    position: absolute; 
    left: 0px; 
    top: 0px; 
    z-index: 0;
}

.stretch {
    width:100%;
    height:100%;
}

Initial URL
http://stackoverflow.com/questions/376253/stretch-and-scale-css-background/388817#388817

Initial Description


Initial Title
Auto-resizable Background

Initial Tags
css, resize, background

Initial Language
CSS