CSS字体重量数字:他们是如何工作的? [英] CSS font-weight numbers: how do they work?
问题描述
我正在尝试使用font-weight来调整字体的粗体。据我所知,值500是正常的字体重量,值700是粗体的默认字体重量。但是,当我放599时,根本不改变字体重量。但是,当我把600,它跳转到粗体的默认字体的重量。价值600-900相同的结果。然后当你超过900,字体重量恢复到正常的字体重量。为什么会发生这种情况?
$ b
#fontStyle {border:1px solid black; font-weight:599;}
< div id = fontStyle > fontStyle< / div>
数字值如何映射到字体权重的详细信息包含在其中规定: 100到900形成一个有序序列,其中每个数字 '599'对于 I'm trying to use font-weight to adjust how bold the font is. From what I understand, value 500 is the normal font weight, and value 700 is the default font weight for bold. However, when I put 599, it did not change the font-weight at all. But when I put 600, it jump to the default font weight of bold. Same results from value 600-900. Then when you go over 900, the font weight reverts back to the normal font weight. Why is this happening?
The details of how numeric values are mapped to font weights are covered in the spec which states: The values '100' to '900' form an ordered sequence, where each number
indicates a weight that is at least as dark as its predecessor. The
keyword 'normal' is synonymous with '400', and 'bold' is synonymous
with '700'. Keywords other than 'normal' and 'bold' have been shown to
be often confused with font names and a numerical scale was therefore
chosen for the 9-value list. '599' is not a valid value for the 这篇关于CSS字体重量数字:他们是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
lockquote
表示至少与其前任一样黑暗的重量。
关键字正常与400同义,粗体与700同义为
。除正常和粗体以外的关键字已经被显示为
经常与字体名称混淆,并且因此为9值列表选择了
。
font-weight
属性
不是有效值#fontStyle {
border: 1px solid black;
font-weight: 599;
}
<div id="fontStyle"> fontStyle </div>
font-weight
property