为什么某些字体在移动浏览器中会变大? [英] Why some font-sizes rendered larger in mobile browsers?

查看:101
本文介绍了为什么某些字体在移动浏览器中会变大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站主页上有一些h和div元素.第一个h2标签和div标签的字体大小为px.我有"-webkit-text-size-adjust:无;"还可以在html和body标签中进行spesification.但是,第一个标签的字体大小在移动浏览器中变得更大.为什么?我该如何解决这个问题?

My website's homepage have some h and div elements. The first h2 tag's and div tag's font sizes are with px. I have "-webkit-text-size-adjust: none;" spesification in html and body tags also. However the first tags's font size's rendered bigger in mobile browsers. Why? How can I solve this problem?

css代码:

h2 {
font-size: 16px;
}
#main h2 {
font-size: 16px;
font-weight: normal;
margin: 0;
}

.introdiv {
font-size: 12px;
line-height: 1.3;
margin: 0;
padding: 0 10px 24px 3px;
}

推荐答案

尝试将其添加到HTML的head标签中.

Try adding this into the head tag of your HTML.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

这篇关于为什么某些字体在移动浏览器中会变大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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