字体大小随刷新而变化

Ken*_*dra 1 html css fonts font-size less

当我最初加载网站时,字体大小都是正常的,但是当我点击刷新时,大小几乎翻倍,并且不会恢复正常。我已经检查过使用 Ctrl+ 和 Ctrl- 更改字体大小,这会将字体更改回正常大小(默认大小的 90% 或 110%)。

一切都得到验证。

http://mylivingspacefinder.com/

======根据作者评论添加======

这是文本大小规则:

h1 {
    .fontSize(10);
}

h2 {
    .fontSize(4);
}

body {
    .fontSize(2);
}

.fontSize(@sizeValue) {
  @remValue: @sizeValue;
  @pxValue: (@sizeValue * 10);
  font-size: ~"@{pxValue}px"; 
  font-size: ~"@{remValue}rem";
}
Run Code Online (Sandbox Code Playgroud)

小智 5

这是 Chrome 中的一个已知错误,https://code.google.com/p/chromium/issues/detail?id=319623

同时尝试在 body 标签上使用 em 而不是 rem 或将 font-size 应用于包装元素

body > div {
  font-size: 1.4rem
}
Run Code Online (Sandbox Code Playgroud)

如此处所示/sf/answers/1412177721/