ios中的图像高度错误

时间:2017-05-29 21:31:02

标签: html ios css css3

我的产品"中的图像高度有问题。我的网站www.takchinsaffron.com的一部分,高度没有设置在ios中。它没有其他设备中的任何错误。

        .grid figure{
           max-width: 100%;
           margin-top: 20px;
         }

enter image description here enter image description here

3 个答案:

答案 0 :(得分:7)

我的父母有display: flex,所以我不得不在图像上放align-self: flex-start

image {
  max-width: 100%;
  height: auto;
  align-self: flex-start;
}

答案 1 :(得分:1)

将'min-heigth:100%'改为'min-heigth:auto',一切正常。 检查css没有将图像高度设置为100%。

如果height为auto且width为某个值,则image保持其宽高比。

如果您的宽度为50px,则高度为50px。 在iOS上,高度为100%的图像成为设备的高度(我现在不知道为什么)。

Byee

答案 2 :(得分:0)

我有同样的问题。我的解决方案是增加宽度:100%;高度:100%;和最小宽度:100%;