font-family

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-family-Attribut gibt an, welche Schriftfamilie zur Darstellung des Textes verwendet wird. Es wird als priorisierte Liste von Schriftfamiliennamen und/oder generischen Schriftfamiliennamen angegeben.

Hinweis: Als Präsentationsattribut hat font-family auch ein entsprechendes CSS-Property: font-family. 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-family="Arial, Helvetica, sans-serif">Sans serif</text>
  <text x="100" y="20" font-family="monospace">Monospace</text>
</svg>

Verwendungshinweise

Wert Siehe font-family
Standardwert Hängt vom User-Agent ab
Animierbar Ja

Für eine Beschreibung der Werte lesen Sie bitte die font-family-Eigenschaft in CSS.

Spezifikationen

Specification
CSS Fonts Module Level 4
# generic-font-families
CSS Fonts Module Level 4
# font-family-prop

Browser-Kompatibilität

BCD tables only load in the browser

Siehe auch