generator-wpd icon indicating copy to clipboard operation
generator-wpd copied to clipboard

【iOS】mobile webkit浏览器对非响应式超宽页面重排会增加已设定的font-size

Open gracezlj opened this issue 10 years ago • 0 comments

问题场景

页面宽度大于屏幕宽时,设定viewport,浏览器(mobile Safari & chrome)会将页面缩小显示,但是会强制将font-size放大

解决办法

设定-webkit-text-adjust-size:100%(移动端暂未发现有副作用)

解析-webkit-text-adjust-size

始于移动端使用,后在PC端被滥用,现PC端webkit新版本已经不支持,不推荐使用; 另 -webkit-text-size-adjust需要设置成100%(仅移动端支持,不会影响PC端样式),不能设置成none(避免仍然支持此属性值的pc端页面放大缩小时无法改变字体)

参考:

  1. Fix font size issue on Mobile Safari (iPhone) where text is rendered inconsistently and some fonts are larger than others?
  2. 一定不能設定成 -webkit-text-size-adjust:none 的原因

gracezlj avatar Dec 20 '14 07:12 gracezlj