Font Size Changing with Refresh

核能气质少年 提交于 2019-12-12 04:09:42

问题


When I initially load my website the font sizes are all normal, but when I hit refresh the size almost doubles, and does not go back to normal. I've checked changing the font size using Ctrl+ and Ctrl- That changes the font back to a normal size (90% or 110% of the default size).

Everything validates.

http://mylivingspacefinder.com/

======Added from author's comment======

Here's the text-size rules:

h1 {
    .fontSize(10);
}

h2 {
    .fontSize(4);
}

body {
    .fontSize(2);
}

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

回答1:


This is a known bug in Chrome, https://code.google.com/p/chromium/issues/detail?id=319623

Meanwhile try using em instead of rem on the body tag or apply font-size to a wrapper element

body > div {
  font-size: 1.4rem
}

as seen here https://stackoverflow.com/a/20173967/2459418



来源:https://stackoverflow.com/questions/21948636/font-size-changing-with-refresh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!