Font weight ignored in Chrome

后端 未结 6 1642
無奈伤痛
無奈伤痛 2021-01-01 08:54

I created a fiddle trying to use Open Sans font with font-weight 300:

HTML

example

CSS

6条回答
  •  醉梦人生
    2021-01-01 09:49

    This seems to be a Chrome/Chromium bug, caused by having the font installed locally on your system. Other browsers don't seem to suffer from this issue.

    So far, it seems to occur on Linux and Windows (confirmed).

    For some reason, it will just load your local font and ignore any of your font-weight rules, even if they're !important. It won't even be consistent with itself: the font weight can change randomly between tabs and page reloads.

    The simplest workaround is to remove the font, but that could be an issue if you need it for something else.

    You might also try renaming the font to something else in order to force Chrome to use your web font and honour your CSS font rules.

提交回复
热议问题