font-weight:900 only working in Firefox

做~自己de王妃 提交于 2019-12-01 22:59:31

It depends on the font. The weight has to be available within the font displayed, or the browser will pick the closest available weight.

Helvetica must not have all of those weights embedded within the font file.

Read about it more here: https://developer.mozilla.org/en/CSS/font-weight

It says:

100, 200, 300, 400, 500, 600, 700, 800, 900

Numeric font weights for fonts that provide more than just normal and bold. If the exact weight given is unavailable, then 600-900 use the closest available darker weight (or, if there is none, the closest available lighter weight), and 100-500 use the closest available lighter weight (or, if there is none, the closest available darker weight). This means that for fonts that provide only normal and bold, 100-500 are normal, and 600-900 are bold.

Perhaps the different browsers have different rules about how to treat font weights when the weight is unavailable.

Most computers do not have a font named “helvetica”, so browsers will fall back to their default font. This may well be different in different browsers. Most fonts on people’s computers have just normal and bold font weight, so the mildly surprising thing is that some browsers implement weight 900 as different from 700 in some situations.

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