图像缩放问题

时间:2013-10-08 02:41:47

标签: html css image pikachoose

我在这里有一个图像大小调整问题:http://goo.gl/UYUuJL使图像缩放,使图像高度按比例填充div“pika-stage”的100%。我很抱歉这已在其他地方得到解答。

这是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中按比例拟合整个图像。这种缩放是否可以以某种方式被媒体图像大小覆盖?任何帮助将非常感激。

由于

1 个答案:

答案 0 :(得分:0)

height: 100%定义为.pika-stage而不是height: auto;

.pika-stage {position: relative; text-align:center; height:100%; max-height:410px; overflow:hidden; background: #000;}