img图片在固定大小的img_box中【水平垂直居中】,【等比大小】缩放显示
<a class="img_box" href="#">
<img src="">
</a>
只需给a设置样式
.img_box{
width:400px;
height:300px;
display:block;
text-align:center;
line-height:36;
}
图片设置样式
.img_box img{
max-width:100%;
max-height:100%;
display:inline;
}
即可实现