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?