Attribut text-decoration-thickness CSS
- Page précédente text-decoration-style
- Page suivante text-emphasis
Recommandation de cours :
Définition et utilisation
L'attribut text-decoration-thickness définit l'épaisseur de la ligne de décoration.
Voir également :Manuel de référence CSS :
Propriété text-decorationtexte CSS
Tutoriel CSS :
Exemple
Définir différentes épaisseurs de lignes de décoration pour les éléments <h1>, <h2>, <h3>, <h4> : text-decoration: underline; text-decoration-thickness: auto; } h2 { text-decoration: underline; text-decoration-thickness: 5px; } h3 { text-decoration: underline; text-decoration-thickness: 50%; } /* Utilisation des propriétés abrégées */ h4 { text-decoration: underline solid red 50%; }
Syntaxe CSS
text-decoration-thickness: auto|from-font|length/percentage|initial|inherit;
Valeur de l'attribut
Valeur | Description |
---|---|
auto | Le navigateur choisit l'épaisseur de la ligne de décoration. |
from-font | Si le fichier de police contient des informations sur l'épaisseur préférée, utilisez cette valeur. Sinon, il est automatique. |
length/percentage | Définit l'épaisseur en valeur de longueur ou en pourcentage. |
initial | Réinitialise cette propriété à sa valeur par défaut. Voir initial. |
inherit | Inherits this property from its parent element. Voir inherit. |
Détails techniques
Valeur par défaut : | auto |
---|---|
Héritage : | Non |
Réalisation des animations : | Non pris en charge. Voir :Propriétés liées aux animations. |
Version : | CSS4 |
Syntaxe JavaScript : | object.style.textDecorationThickness="5px" |
Support du navigateur
Les nombres dans le tableau indiquent la version du navigateur qui prend en charge cette propriété pour la première fois.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
89.0 | 89.0 | 70.0 | 12.1 | 75.0 |
- Page précédente text-decoration-style
- Page suivante text-emphasis