iPhone Safari CSS rotation bug

荒凉一梦 提交于 2019-12-03 09:05:07
Livingston Samuel

It's because Mobile Safari on iPhone & iPod Touch does automatic font-size adjustment.

You can disable it with the following css rule,

html {-webkit-text-size-adjust:none}

More info from Safari Reference Library

Have you tried including a viewport meta tag, such as this:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

Otherwise, you could try creating orientation-specific CSS stylesheets and swap them out w/ javascript when the orientation change event fires, but I prefer the meta tag method above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!