這個font-weight“屬性”是指相對於同一字體係列中的其他字體,用於呈現文本的字形的粗體或明暗度。
用法:
font-variant="variation"
屬性值:
- Default value:默認值是正常的。
- other value:其他值包括粗體,粗體,淺色。
我們將使用font-weight屬性設置字體的粗細。
範例1:
HTML
<!DOCTYPE html>
<html>
<body>
<svg viewBox="0 0 200 300"
xmlns="http://www.w3.org/2000/svg">
<text x="5" y="20"
font-weight="Normal">
Normal text
</text>
</svg>
</body>
</html>
輸出:
範例2:
HTML
<!DOCTYPE html>
<html>
<body>
<svg viewBox="0 0 200 300"
xmlns="http://www.w3.org/2000/svg">
<text x="5" y="20" font-weight="bold">
bold text
</text>
</svg>
</body>
</html>
輸出:
相關用法
- HTML Style fontWeight用法及代碼示例
- Fabric.js Textbox fontWeight屬性用法及代碼示例
- Fabric.js Itext fontWeight屬性用法及代碼示例
- SVG viewBox屬性用法及代碼示例
- SVG rx屬性用法及代碼示例
- SVG width屬性用法及代碼示例
- SVG opacity屬性用法及代碼示例
- SVG stroke-width屬性用法及代碼示例
- SVG stroke屬性用法及代碼示例
- SVG height屬性用法及代碼示例
- SVG ry屬性用法及代碼示例
- SVG fill屬性用法及代碼示例
- SVG font-size屬性用法及代碼示例
- SVG stroke-dasharray屬性用法及代碼示例
- SVG cx屬性用法及代碼示例
- SVG flood-opacity屬性用法及代碼示例
- SVG filter屬性用法及代碼示例
注:本文由純淨天空篩選整理自taran910大神的英文原創作品 SVG font-weight Attribute。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。