【问题标题】:Why min-height 100vh on iOS 10 results in large window?为什么 iOS 10 上的 min-height 100vh 会导致大窗口?
【发布时间】:2019-03-04 02:06:35
【问题描述】:

有人可以向我解释为什么当我将部分的 min-height 设置为 calc(100vh) 时,它会导致 iOS 10 (iPhone SE) 上的窗口尺寸变大而文本变小吗?

section {
  display: flex;
  display: -webkit-flex;
  display: -webkit-box;
  align-items: center;
  -webkit-align-items: center;
  -webkit-box-align: center;
  min-height: calc(100vh);
  text-align: center;
}

section div {
  width: 100%;
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Title</title>
  </head>
  <body>
    <section>
      <div>
        <h1>Title</h1>
        <h2>Description</h2>
      </div>
    </section>
  </body>
</html>

【问题讨论】:

标签: html ios css mobile-safari


【解决方案1】:

您是否设置了默认的车身样式。 body{margin:0; padding:0} 如果没有,请试试这个。如果您使用上面的html,css,它可能会解决您的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2019-03-27
    • 2023-04-04
    • 2015-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多