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
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>