我在这里遇到图像大小问题:http://goo.gl/UYUuJL在使图像缩放时,图像高度按比例填充 100% 的 div“pika-stage”。我很抱歉,这已在其他地方得到回答。
这是 CSS:
.pika-stage {
position: relative;
text-align: center;
height: auto;
max-height: 410px;
overflow: hidden;
background: #000;
}
.pika-stage img {
height: 100% !important;
position: relative;
}
以该图库中最右上角的缩略图为例:原始尺寸:1364 × 2921(腿上应该有一头大象)。单击缩略图后,它不会将图像缩放到足以在“pika-stage”div 中按比例容纳整个图像。这种缩放是否可以以某种方式被媒体图像大小覆盖?任何帮助将非常感激。
谢谢
最佳答案
定义 height: 100%
到你的 .pika-stage
而不是 height: auto;
.pika-stage {position: relative; text-align:center; height:100%; max-height:410px; overflow:hidden; background: #000;}
关于html - 图像缩放问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19238199/