Style textDecoration Property
Exemple
Définissez la décoration du texte pour un élément :
document.getElementById("demo").style.textDecoration = "underline overline";
Définition et utilisation
La propriété textDecoration définit ou renvoie une ou plusieurs décorations pour un texte.
Conseil : Pour spécifier plusieurs types de décoration pour un élément, spécifiez une liste de types de décoration séparés par des espaces.
Prise en charge du navigateur
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Syntaxe
Renvoyez la propriété textDecoration :
object.style.textDecoration
Définissez la propriété textDecoration :
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
none | Defines a normal text. This is default |
underline | Defines a line under the text |
overline | Defines a line over the text |
line-through | Defines a line through the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Détails techniques
Valeur par défaut: | rien |
---|---|
Valeur de retour : | Une chaîne, représentant la décoration ajoutée au texte |
Version CSS | CSS1 |
Plus d'exemples
Exemple
Renvoie la décoration textuelle d'un élément :
alert(document.getElementById("demo").style.textDecoration);
Pages connexes
Tutoriel CSS : Texte CSS
Référence CSS : propriété text-decoration
❮ Objet de style