font-weight
font-weight 屬性指的是用於渲染文字的字形的粗細程度,相對於同一字體系列中的其他字型而言。
注意: 作為一個呈現屬性,font-weight 還有一個對應的 CSS 屬性:font-weight。當兩者都指定時,CSS 屬性具有優先權。
你可以將此屬性與以下 SVG 元素一起使用
示例
控制 SVG 字型粗細
html
<svg viewBox="0 0 200 30" xmlns="http://www.w3.org/2000/svg">
<text y="20" font-weight="normal">Normal text</text>
<text x="100" y="20" font-weight="bold">Bold text</text>
</svg>
用法說明
| 值 |
normal | bold | bolder | lighter | <number> |
|---|---|
| 預設值 | normal |
| 可動畫的 | 是 |
有關值的描述,請參閱 CSS font-weight 屬性。
規範
| 規範 |
|---|
| CSS 字型模組第 4 級 # font-weight-prop |
瀏覽器相容性
載入中…
另見
- CSS
font-weight屬性