gpt4 book ai didi

html - CSS 字体粗细数字 : how do they work?

转载 作者:太空狗 更新时间:2023-10-29 13:38:49 30 4
gpt4 key购买 nike

我正在尝试使用 font-weight 来调整字体的粗体程度。据我了解,值 500 是正常字体粗细,值 700 是粗体的默认字体粗细。

但是,当我输入 599 时,它根本没有改变 font-weight。但是当我输入 600 时,它会跳到默认的粗体字重。值 600-900 的结果相同。然后,当您超过 900 时,字体粗细会恢复为正常字体粗细。为什么会这样?

#fontStyle {
border: 1px solid black;
font-weight: 599;
}
<div id="fontStyle"> fontStyle </div>

最佳答案

涵盖了如何将数值映射到字体粗细的详细信息in the spec其中指出:

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' 不是 font-weight 属性的有效值

关于html - CSS 字体粗细数字 : how do they work?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35471486/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com