【发布时间】:2014-04-10 05:25:43
【问题描述】:
当图像小于 400 像素时,图像会按比例调整大小,并在 400 像素处停止垂直缩放,但宽度会继续缩放(从而扭曲图像)。有没有什么办法解决这一问题?任何帮助将不胜感激。
CSS:
#gallery{
height:100%;
min-height:400px;
max-height:800px;
min-width:400px;
text-align:center;
width:100%;
}
#gallery .section {
height:80%;
min-height:400px;
max-height:800px;
}
#gallery .section img{
height:100%;
min-height:400px;
max-height:800px;
width:auto;
}
HTML:
<div id="gallery">
<div class="section">
<img src="images/1.jpg" alt="">
</div>
</div>
【问题讨论】:
-
大于800px也会出现失真。
-
从
#gallery .section img中删除min-height:400px;和max-height:800px;