Posted By

f6design on 05/13/11


Tagged

image background scale


Versions (?)

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


 / Published in: CSS
 

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.

  1. img.bg {
  2. height: auto;
  3. left: 0;
  4. min-height: 100%;
  5. min-width: 1024px; /*adjust this to match image width */
  6. position: fixed;
  7. top: 0;
  8. width: 100%;
  9. z-index: -1;
  10. }

Report this snippet  

You need to login to post a comment.