相关疑难解决方法(0)

Chrome不尊重body标签上的rem字体大小?

我已经开始rem在最近的项目中使用's来调整字体大小,然后使用px作为旧版IE的后备版.

我也设置了font-size62.5%,html所以我可以在样式表中更轻松地设置字体大小,然后我1.4rem在主体上设置字体大小,所以没有样式的元素有font-size至少14像素的基数,请参阅代码如下:

html { font-size: 62.5%; } /* font-size: 62.5% now means that 1.0 rem = 10px */
body { background: #fff; font-family: arial; font-size: 1.4rem; line-height: 1.6rem; }
Run Code Online (Sandbox Code Playgroud)

问题是,Chrome似乎以一种奇怪的方式处理这个问题...... Chrome似乎在初始页面加载时正确设置了字体大小,但在随后的刷新中,字体大小比它们应该更大.

查看FIDDLE(HTML复制如下以供将来参考)

<!DOCTYPE html>
<html lang="en-GB">
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <p>This is a test, this font should have font-size of 14px.</p> 
        <p>This is a test, this font should have font-size of 14px.</p> 
        <p>This is a test, this font …
Run Code Online (Sandbox Code Playgroud)

html css google-chrome

13
推荐指数
3
解决办法
2万
查看次数

标签 统计

css ×1

google-chrome ×1

html ×1