<div class="img-box">
<img src="XXX" />
</div>
.img-box {
position: relative;
}
.img-box:before {
content: "";
display: block;
padding-top: 100%;
}
.img-box img {
position: absolute;
top: 0;
left: 0;
width: 90% !important;
height: 90%;
border-radius: 6px;
object-fit: cover; // 仿小程序端,mode="aspectFill"
}