【问题标题】:Why does flex item get stretched iOS 13?为什么 flex 项目会在 iOS 13 中被拉伸?
【发布时间】:2021-10-31 12:18:58
【问题描述】:

Here is the complete code on codepen

    .Card {
      max-width: 20%;
      max-height: 100%;
      height: auto;
    }
   .Cards {
     display: flex;
     flex-direction: row;
     flex-wrap: wrap;
     justify-content: space-around;
   }

除 iOS 13 之外的所有设备上的视图看起来都不错,看起来卡片被拉伸了。 Stretched on iOS 13

有谁知道如何解决这个问题? 谢谢!!!

【问题讨论】:

    标签: javascript css ios iphone browser


    【解决方案1】:

    鉴于 iOS 15 现已发布,我认识到 iOS 13 不再是一个严重的问题,但为了记录,这个问题可以通过在您的 .Cards 容器上设置 align-items: start; 来解决:

    【讨论】:

      【解决方案2】:

      CSS 的 max-width 和 max-height 属性效果更好,但许多浏览器不支持它们。

      尝试对图像使用object-fit 属性。

      【讨论】:

      猜你喜欢
      • 2018-02-17
      • 2022-01-12
      • 1970-01-01
      • 2021-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多