Propriété CSS text-decoration-line
Exemple
Définissez différents types de lignes de décoration de texte :
div.a
{
text-decoration-line: overline;
}
div.b
{
text-decoration-line: underline;
}
div.c
{
text-decoration-line: line-through;
}
div.d
{
text-decoration-line: overline underline;
}
Définition et utilisation
La text-decoration-line
propriété définit le type de décoration de texte à utiliser (comme souligné, surligné, traversant).
Conseil : examinez également la propriété text-decoration , qui est une propriété abrégée pour text-decoration-line, text-decoration-style et text-decoration-color.
Remarque : Vous pouvez également combiner plusieurs valeurs, telles que le soulignement et le surlignement, pour afficher des lignes sous et au-dessus du texte.
Valeur par défaut: | rien |
---|---|
Hérité: | non |
Animable : | non. En savoir plus sur l'animation |
Version: | CSS3 |
Syntaxe JavaScript : | objet .style.textDecorationLine="overline" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Les nombres suivis de -moz- ou -webkit- spécifient la première version qui a fonctionné avec un préfixe.
Property | |||||
---|---|---|---|---|---|
text-decoration-line | 57.0 | 79.0 | 36.0 6.0 -moz- |
12.1 7.1 -webkit- |
44.0 |
Syntaxe CSS
text-decoration-line: none|underline|overline|line-through|initial|inherit;
Valeurs de propriété
Value | Description | Play it |
---|---|---|
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 |
Pages connexes
Tutoriel CSS : Texte CSS
Référence HTML DOM : propriété textDecorationLine