【问题标题】:How to ignore the phone's font size setting with CSS?如何使用 CSS 忽略手机的字体大小设置?
【发布时间】:2021-10-26 09:40:41
【问题描述】:

我有一个主要用于移动设备的网络应用。在手机上看起来像货,但在系统设置中增加字体大小后,它看起来很丑陋。无论字体大小配置是什么,是否有任何 CSS 技巧、hack 或作弊让它看起来一样?非常感谢!

Normal Look After Setting Horrified look

【问题讨论】:

    标签: android css ios responsive font-size


    【解决方案1】:

    将以下内容添加到您的 CSS 以避免发生这种情况:

    html,body {
      text-size-adjust: none;
      -webkit-text-size-adjust: none;
      -ms-text-size-adjust: none;
      -moz-text-size-adjust: none;
    }
    

    【讨论】:

    • 感谢您的回答,抱歉迟到了!
    【解决方案2】:

    您可以尝试将text-size-adjust: none; css 添加到您的 html 正文标签中,它会阻止文本大小增加。更多详情here.

    html,body {
      text-size-adjust: none;
      -webkit-text-size-adjust: none;
      -moz-text-size-adjust: none;
      -ms-text-size-adjust: none;
    }
    

    【讨论】:

    • 谢谢你的回答,希望我能同时接受你和上面的回答:sweat_smile
    猜你喜欢
    • 2012-02-08
    • 2023-01-22
    • 1970-01-01
    • 2012-08-06
    • 1970-01-01
    • 2013-05-16
    • 1970-01-01
    • 1970-01-01
    • 2014-07-21
    相关资源
    最近更新 更多