如何防止移动设备缩放字体大小 [英] How to prevent mobile devices to scale font size

查看:159
本文介绍了如何防止移动设备缩放字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

您最有可能在寻找这个:

包含以下<$ c文档的< head> 部分中的$ c>< meta> 标签:

 < meta name =viewportcontent =width = device-width,initial-scale = 1> 

它帮助我解决了同样的问题。


On our website we have the following phenomenon: When rendering the website on a desktop browser (Firefox, IE, Chrome), all fonts, in particular those embedded in <td> tags, are rendered in the same size.

However, when rendering the website on a mobile device, the font size of the texts within the <td> tags shrinks. See below. We tried to set

html { 
    -webkit-text-size-adjust: none; 
}

but this only helps with the problem on the mobile safari and opera browser. Using the tips from this website, we added

@media (max-width: 960px) {
   td {
        font-size: 20pt;
   }
}

to the css, but this now miraculously only works for one of our phones held tilted sideways, not in portrait. How do we prevent the font-size within the table cells to be scaled down?

解决方案

You were most likely looking for this:

Include the following <meta> tag in the document's <head> section:

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

It helped me with the same problem.

这篇关于如何防止移动设备缩放字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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