为什么移动设备的字体大小取决于纵向或横向? [英] Why is font size changing depending on portrait or landscape for mobile devices?

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

问题描述

我正在使用 px 字体大小,这可能与它有关。

I'm using px font size, which may have something to do with it.

但是,肖像我的字体大小是一个不错的阅读尺寸:

However, portrait my font size is a good reading size:

但是,风景字体太大。 这是iPhone 6+屏幕

But landscape the font size is just too large. This is an iPhone 6+ screen

解决此问题的最佳方法是对纵向和横向模式进行媒体查询吗?

Is the best way to resolve this, a media query for portrait and landscape mode?

推荐答案

在CSS文件中设置text-size-adjust属性,如下所示:

Set the text-size-adjust property in your CSS file like this:

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

更多信息,请参见 https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust

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

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