css3 - rem布局下,用户浏览器的最小字号是12px怎么办?
巴扎黑
巴扎黑 2017-04-17 11:46:47
0
12
1482

我设置了
html{

font-size:62.5%; <!-- font-size: 10px;-->

}
在iphone6上浏览没有问题,但是当我打开web chrome之后,发觉我的页面错乱。

我知道用户浏览器最小字体是12px的话,会无视这条声明,会继续12px。

即便我用于调试的浏览器设置了10px也无法保证所有用户都是如此的。(中文版chrome默认最小字号12px)

那么,我该怎么做才能在浏览器最小字号12px的浏览器上,实现 1rem === 10px 呢?

巴扎黑
巴扎黑

reply all(12)
伊谢尔伦

You can use other browsers to test. Generally, the design draft will not be lower than 12px...

Ty80

Use rem to solve the problem of mobile site adaptation. It is not recommended to use Chrome browser during debugging. The minimum font size is size 12, but on mobile pages, the font size can be smaller than size 12, resulting in a situation where what you see is not what you get. Therefore, it is recommended to use firefox for debugging.

伊谢尔伦

Set to 100px

迷茫

Adjust rem base value

Peter_Zhu

Rem is set to 20px (125%)
The advantage is that it will not appear below the minimum font size (Chrome, etc), and there will be no rounding error (IE when expressed as a percentage, etc). In addition, it converts to integer Font size is easy.

迷茫

I usually use transform:scale(.8,.8);

Peter_Zhu

Chrome can set the minimum font. If it is just a mobile terminal, there is no need to worry. Fonts smaller than 12px are very compatible. If it is a PC, it is recommended not to use fonts smaller than 12px

巴扎黑

使用-ms-text-size-adjust:none;-webkit-text-size-adjust:none;

Ty80

If it is less than 10px, do you still expect users to see it clearly?

巴扎黑

Chrome Set Minimum Font: Advanced Settings/Characters and Encoding

Of course, you can have a need for fonts smaller than 12px, which should be used in mobile projects and development Stages are convenient for debugging in Chrome.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template