<div style="inbox">
<img src=""/>
</div>
<style>
.inbox{
position:relative;
padding-top:100%;
width:100%;
}
.inbox img{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
object-fit:cover;
}
</style>
<div style="inbox">
<img src=""/>
</div>
<style>
.inbox{
position:relative;
padding-top:100%;
width:100%;
}
.inbox img{
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
object-fit:cover;
}
</style>
转载于:https://www.cnblogs.com/yuyedaocao/p/9153503.html