Return to Snippet

Revision: 46132
at May 13, 2011 07:53 by f6design


Initial Code
img.bg {
    height: auto;
    left: 0;
    min-height: 100%;
    min-width: 1024px; /*adjust this to match image width */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: -1;
}

Initial URL

                                

Initial Description
Note that this approach DOESN'T maintain the image's aspect ratio. For a pure CSS technique that does that you need a CSS3 approach.

Initial Title
100% scale background image (doesn\'t preserve aspect ratio)

Initial Tags
image, background

Initial Language
CSS