页面即要保持响应式的结构又要保持图片的某全比例不变,解决方法:
html代码:
<div class="img-responsive">
<img src="http://d13yacurqjgara.cloudfront.net/users/14765/screenshots/1392915/mrbc-badge-....png"
/>
</div>
css代码:
.img-responsive {
max-width: 100%;
height: 0;
padding-bottom: 60%;
background-color:#ff0000;
overflow: hidden;
}
.img-responsive img {
width: 100%;
}
http://jsfiddle.net/luin/3g5AZ/