<tspan>
A l'intérieur d'un élément <text>
, les propriétés du texte et des polices, ainsi que la position actuelle du texte, peuvent être ajustées de façon absolue ou relative à partir des coodonnées précisées dans un élément tspan
.
Contexte d'utilisation
Catégories | Elément conteneur de texte, Elément enfant de conteneur de texte |
---|---|
Contenu autorisé | Des caractères et n'importe quel nombre des éléments suivants, dans n'importe quel ordre: Éléments descriptifs <a> , <altGlyph> , <animate> , <animateColor> , <set> (en-US), <tref> (en-US), <tspan> |
Exemple
<svg viewBox="0 0 240 40" xmlns="http://www.w3.org/2000/svg">
<style>
text { font: italic 12px serif; }
tspan { font: bold 10px sans-serif; fill: red; }
</style>
<text x="10" y="30" class="small">
Vous êtes
<tspan>not</tspan>
une banane !
</text>
</svg>
Attributs
Attributs globaux
Specific attributes
Interface DOM
Cet élément implémente l'interface SVGTSpanElement (en-US).
Spécifications
Spécification | Statut | Commentaire |
---|---|---|
Scalable Vector Graphics (SVG) 2 La définition de '<tspan>' dans cette spécification. |
Candidat au statut de recommandation | |
Scalable Vector Graphics (SVG) 1.1 (Second Edition) La définition de '<tspan>' dans cette spécification. |
Recommendation | Définition originale |
Compatibilité des navigateurs
BCD tables only load in the browser