<div class='test'>
<img src='https://img-blog.csdnimg.cn/20191114165410337.png?x-oss-process=image/resize,m_fixed,h_96,w_96'>
</div>
.test{width:225px;height:300px;border:1px solid #c4c6c9;border-radius:9px;overflow: hidden;position:relative;}
.test img{position:absolute;margin:auto;top:-9999px;right:-9999px;bottom: -9999px;left: -9999px;max-width:100%;max-height:100%}
运行结果