1

I want to set a background image on my webpage. I'm using background-size=cover for this. It gives me exactly what I want but it doesn't work in IE8. I tried this solution which uses filter

#container{
    position: absolute;
    height: 100%;
    width: 100%;

    background: url('img/dogs.jpg') no-repeat center center;
    background-size: cover;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/dogs.jpg', sizingMethod='scale');
    -ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/dogs.jpg', sizingMethod='scale');
}

But it only seems to stretch the image in order to fit it to background and distorts the aspect ratio of the image. Can someone please suggest any other solution?

Community
  • 1
  • 1
sublime
  • 4,013
  • 9
  • 53
  • 92
  • 2
    There's a way around this here: http://stackoverflow.com/a/9169401/2138446 – AJB123 Mar 25 '13 at 22:32
  • yes I've mentioned it in my question, I have tried that solution, it does work but it distorts the image aspect ratio. – sublime Mar 25 '13 at 22:39

0 Answers0