【问题标题】:Font-size on mobile device移动设备上的字体大小
【发布时间】:2014-10-09 06:22:50
【问题描述】:

我在我的 body 元素上设置了font-size: 12px。但在移动设备上,某些元素的字体大小超过 12 像素(例如,元素 p)。为什么会这样?如何解决这个问题?

body {
   font: normal normal 400 12px/1.5 "Droid Sans", Helvetica, "Helvetica Neue", Arial, sans-serif;
}

.footer {
    background: #1d3057;
    padding: 15px 30px;
    color: #dedede;
    width: 100%;
    box-sizing: border-box;
}
. footer span {
   display: inline-block;
   white-space: pre;
   float: left;
   font-size: 12px;

}

【问题讨论】:

  • 移动设备会调整字体大小以提高可读性。您可以通过在 CSS 中定位移动设备来将其强制为所需的大小。 More information can be found in this answer.
  • 为什么尺寸会在跨度中发生变化,并且仅在 Chrome 中有时会发生变化? 4 个 Chrome 中有 2 个不会改变大小。

标签: css mobile


【解决方案1】:

你可以使用这个解决方案:

* { max-height: 999999px; }

【讨论】:

    猜你喜欢
    • 2013-04-09
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 2016-06-04
    • 1970-01-01
    • 2012-09-09
    • 2012-02-28
    • 2013-07-28
    相关资源
    最近更新 更多