Stretch a background image in IE8

前端 未结 7 821
时光说笑
时光说笑 2020-12-14 13:29

I\'m trying to stretch a background image to 100% width and height of the parent div. background-size is not supported in IE8 of-course. I tried the following code but it\'s

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 13:39

    I combined AlfaImageLoader filter with css3 background-size and worked on all browsers. Here's what i did.

    background : url('../images/background.jpg') no-repeat ;
    background-size: 100%;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader
                (src='images/background.jpg',sizingMethod='scale');
    

    By the way, you need to put your background image to your wrapper div in this method.

提交回复
热议问题