一些字体大小的Safari(iPhone) [英] Some font-size's rendered larger on Safari (iPhone)

查看:515
本文介绍了一些字体大小的Safari(iPhone)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有CSS或其他原因为什么Safari / iPhone会忽略一些字体大小设置?在我的特定网站上Safari上的Safari呈现一些font-size:13px文本大于font-size:15px文本。是否可能不支持某些元素的字体大小?

Are there CSS or other reasons why Safari/iPhone would ignore some font-size settings? On my particular website Safari on the iPhone renders some font-size:13px text larger than font-size:15px text. Does it maybe not support font-size on some elements?

推荐答案

Joe的响应有一些很好的最佳实践,你描述的问题围绕着事实,如果移动Safari自动缩放文本,如果它认为文本将呈现太小。你可以使用CSS属性 -webkit-text-size-adjust 来解决这个问题。下面是一个如何将这个应用到你的身体,只是为iPhone:

Joe's response has some good best practices in it, but I think the problem you're describing centers around the fact that Mobile Safari automatically scales text if it thinks the text will render too small. You can get around this with the CSS property -webkit-text-size-adjust. Here's a sample of how to apply this to your body, just for the iPhone:

@media screen and (max-device-width: 480px){
  body{
    -webkit-text-size-adjust: none;
  }
}

这篇关于一些字体大小的Safari(iPhone)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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