The problem of img display in inline-block elements in IE browser

recently found a problem in the ie browser while working on the project. The maximum width of the display: inline-block-wrapped img is always the original size of the picture, while the maximum width of the display: block-wrapped img is the width of the parent element. As shown below:
IE browser

Chrome

Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>IE</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        img{
            max-width: 100%;
        }
        .container{
            width: 500px;
            padding: 10px;
            border: 1px solid -sharpf60;
            margin: 10px;
        }
        .inline-block{
            display: inline-block;
        }

    </style>
</head>
<body>
    <div class="container">
        <h2>IEinlin-block</h2>
        <div class="inline-block">
            <img src="https://car3.autoimg.cn/cardfs/product/g28/M02/C6/9F/1024x0_1_q87_autohomecar__ChsEfVvNn3CALbzCAAidpVCRMmU628.jpg" alt="">
        </div>
        <br>
        <br>
        <h2>IEblock</h2>
        <div class="block">
            <img src="https://car3.autoimg.cn/cardfs/product/g28/M02/C6/9F/1024x0_1_q87_autohomecar__ChsEfVvNn3CALbzCAAidpVCRMmU628.jpg" alt="">
        </div>
    </div>
</body>
</html>

this is not an inline-block problem, this is because you set the width of container, but inline-block does not set the width, so it is propped up by the picture. Google is more advanced and can fix some errors, but ie can't. So the solution is as follows:

.inline-block{
    width:100%;
    display: inline-block;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36a88-2b883.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36a88-2b883.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?