How to make IE8 compatible with background-size

ie6, ie7, ie8 do not support css background-size, so how to be compatible with background-size under ie?
Under ie, the image is completely centered and displayed within a certain range

Add the following code in css:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
    src='image address.jpg',
    sizingMethod='scale');

The complete example code is given below:

<html>
<head>
<meta charset="UTF-8">
<title>How to make IE compatible with background-size</title>

<style>
.bgpic {
    background-image: url('image address.jpg');
    background-size: 100% 100%;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
    src='image address.jpg',
    sizingMethod='scale');
}
</style>
</head>
<body>

    <div  class="bgpic" style="width:200px;height:100px;"></div>

</body>
</html>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324915975&siteId=291194637