Propriété textDecorationLine de style
Exemple
Affichez un élément avec une ligne traversant le texte :
document.getElementById("demo").style.textDecorationLine = "line-through";
Définition et utilisation
La propriété textDecorationLine définit ou renvoie le type de ligne, le cas échéant, que la décoration aura.
Remarque : Vous pouvez également définir textDecorationLine à l'aide de la propriété textDecoration, qui est une propriété abrégée pour les propriétés textDecorationLine, textDecorationStyle et textDecorationColor.
Remarque : Vous pouvez également combiner plusieurs valeurs, telles que le soulignement et le surlignement, pour afficher des lignes sous et au-dessus du texte.
Prise en charge du navigateur
Property | |||||
---|---|---|---|---|---|
textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz |
7.0 Webkit | 44.0 |
Syntaxe
Renvoyez la propriété textDecorationLine :
object.style.textDecorationLine
Définissez la propriété textDecorationLine :
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
none | Default value. Specifies no line for the text-decoration |
underline | Specifies that a line will be displayed under the text |
overline | Specifies that a line will be displayed over the text |
line-through | Specifies that a line will be displayed 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 propriété text-decoration-line d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété text-decoration-line
❮ Objet de style