iPhone Safari CSS旋转错误 [英] iPhone Safari CSS rotation bug
问题描述
我有一个小的手机应用程序,在iPhone / Mobile Safari上奇怪的行为。页面呈现和工作时,它的方向是垂直的。当我将手机水平旋转一些,但不是页面上的所有元素正确调整大小。一些标题元素将保持几乎相同的大小,可能增加10%,其他人的大小将翻倍。
I have a small mobile phone app that is acting strangely on the iPhone/Mobile Safari. The page renders and works great when it's orientation is vertical. When I rotate the phone horizontally some, but not all elements on the page resize correctly. Some header elements will stay nearly their same size, maybe increasing by 10%, others will double in size.
有没有人遇到这个?我的第一个想法是,css可以有基于ems和px的大小的混合,但找到每个大小的元素,并将它们转换为em不改变一个东西。
Has anyone run into this? My first thought was that the css could have a mix of sizes based on ems and px's but finding every size element and converting them to em's didn't change a thing.
推荐答案
这是因为iPhone上的Mobile Safari和&
It's because Mobile Safari on iPhone & iPod Touch does automatic font-size adjustment.
您可以使用以下css规则禁用它:
You can disable it with the following css rule,
code> html {-webkit-text-size-adjust:none}
html {-webkit-text-size-adjust:none}
More info from Safari Reference Library
这篇关于iPhone Safari CSS旋转错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!