移动设备上纵向和横向的字体大小 [英] Font size in portrait vs. landscape on mobile devices

查看:86
本文介绍了移动设备上纵向和横向的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个移动网站,但遇到了此问题-横向显示的14px字体比纵向显示的字体大得多.但是,这似乎是基于Div大小设置为100%的事实,因此在景观环境中,它显然更宽.我不明白的是,鉴于14px不是相对大小而是固定大小,为什么这应该影响字体的大小?

I am developing a mobile website but have encountered this problem - a font size of 14px is displaying much larger in landscape than in portrait. However, it seems to be based on the fact that the Div size is set to 100% so in landscape it is obviously wider. What I don't understand is why that should affect the size of the font given that 14px isn't a relative size but a fixed one?

我对此有没有解释?感谢任何答案(只要您不告诉我,我就是缺少明显的东西的白痴!)

Is there an explanation for this that I am missing? Appreciate any answers (so long as you don't tell me I'm an idiot for missing something obvious!)

推荐答案

当视口更改时,Apple会调整字体大小以提高可读性.字体大小设置为绝对值(如14px)并不重要.要禁用它,可以使用以下CSS:

Apple rescales the font-size when the viewport changes to increase readability. It doesn't matter that the font-size is set to something absolute like 14px. To disable it, you can use the following CSS:

-webkit-text-size-adjust: none;

这篇关于移动设备上纵向和横向的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆