font-weight

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Das font-weight-Attribut bezieht sich auf die Stärke oder Leichtigkeit der Glyphen, die zum Rendern des Textes verwendet werden, relativ zu anderen Schriftarten in der gleichen Schriftfamilie.

Hinweis: Als Präsentationsattribut hat font-weight auch ein entsprechendes CSS-Attribut: font-weight. Wenn beide angegeben sind, hat die CSS-Eigenschaft Vorrang.

Dieses Attribut kann mit den folgenden SVG-Elementen verwendet werden:

Beispiel

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>

Nutzungshinweise

Wert normal | bold | bolder | lighter | <number>
Standardwert normal
Animierbar Ja

Für eine Beschreibung der Werte konsultieren Sie bitte die CSS font-weight-Eigenschaft.

Spezifikationen

Specification
CSS Fonts Module Level 4
# font-weight-prop

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
font-weight

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch