CSS中图片居中显示不拉伸,且占满盒子大小
<div class="img_box">
<img class="img" src='URL'/>
</div>
.img_box{
width:200px;
height:200px;
position:relative;
}
.img {
max-width: 100%;
max-height: 100%;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
display: block;
}