How do I make background-size work in IE?

前端 未结 8 2215
无人共我
无人共我 2020-11-22 00:30

Is there any known way to make the CSS style background-size work in IE?

8条回答
  •  耶瑟儿~
    2020-11-22 01:03

    A bit late, but this could also be useful. There is an IE filter, for IE 5.5+, which you can apply:

    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
    src='images/logo.gif',
    sizingMethod='scale');
    
    -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(
    src='images/logo.gif',
    sizingMethod='scale')";
    

    However, this scales the entire image to fit in the allocated area, so if you're using a sprite, this may cause issues.

    Specification: AlphaImageLoader Filter @microsoft

提交回复
热议问题