一些字体大小的Safari(iPhone)

编程入门 行业动态 更新时间:2024-10-27 13:29:26
本文介绍了一些字体大小的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)

本文发布于:2023-11-04 21:49:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559104.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体大小   Safari   iPhone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!