aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/css/text-decoration-thickness/index.html
blob: 31e4448fe8d5e67ba5cdc6e9e321e5fc7416962e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: text-decoration-thickness
slug: Web/CSS/text-decoration-thickness
tags:
  - CSS
  - Propriété
  - Reference
translation_of: Web/CSS/text-decoration-thickness
---
<div>{{CSSRef}}</div>

<p>La propriété CSS <strong><code>text-decoration-thickness</code></strong> définit l'épaisseur ou la largeur de la ligne de décoration utilisée sur le texte d'un élément (la ligne qui raye, souligne ou surligne le texte).</p>

<h2 id="Syntaxe">Syntaxe</h2>

<pre class="brush:css no-line-numbers">/* Un seul mot-clé*/
text-decoration-thickness: auto;
text-decoration-thickness: from-font;

/* Une valeur de longueur */
text-decoration-thickness: 0.1em;
text-decoration-thickness: 3px;

/* Valeurs globales */
text-decoration-thickness: inherit;
text-decoration-thickness: initial;
text-decoration-thickness: unset;
</pre>

<h3 id="Valeurs">Valeurs</h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>Le navigateur choisit l'épaisseur pour la ligne de décoration.</dd>
 <dt><code>from-font</code></dt>
 <dd>Si le fichier de la police indique une épaisseur préférée, c'est cette valeur qui est utilisée. Si le fichier ne contient pas cette information, cette valeur est synonyme de <code>auto</code>.</dd>
 <dt><code>&lt;length&gt;</code></dt>
 <dd>Specifies the thickness of text decoration line as a {{cssxref('length')}}, overriding the font file suggestion or the browser default.</dd>
</dl>

<h3 id="Syntaxe_formelle">Syntaxe formelle</h3>

{{csssyntax}}

<h2 id="Exemples">Exemples</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;p class="longhand"&gt;Voici du texte avec un soulignement rouge de 2px.&lt;/p&gt;
&lt;p class="under-and-over"&gt;Celui est souligné et surligné.&lt;/p&gt;
&lt;p class="shorthand"&gt;Ce texte sera souligné avec une ligne bleue de 1px si la formulation raccourcie est prise en charge.&lt;/p&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">.longhand {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-color: red;
  text-decoration-thickness: 2px;
}

.under-and-over {
  text-decoration-line: underline overline;
  text-decoration-style: solid;
  text-decoration-color: orange;
  text-decoration-thickness: 0.2rem;
}

.shorthand {
  text-decoration: underline solid blue 1px;
}</pre>

<h3 id="Résultat">Résultat</h3>

<p>{{EmbedLiveSample('Exemples', '', '', '')}}</p>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">État</th>
   <th scope="col">Commentaires</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 Text Decoration', '#text-decoration-width-property', 'text-decoration-width')}}</td>
   <td>{{Spec2('CSS4 Text Decoration')}}</td>
   <td>Définition initiale.</td>
  </tr>
 </tbody>
</table>

<div class="blockIndicator note">
<p><strong>Note :</strong> Cette propriété était initialement intitulée <code>text-decoration-width</code> mais fut renommée en 2019 en <code>text-decoration-thickness</code>.</p>
</div>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<div class="hidden">Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à consulter <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> et à nous envoyer une <em>pull request</em>.</div>

<p>{{Compat("css.properties.text-decoration-thickness")}}</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li>{{cssxref("text-decoration")}}</li>
 <li>{{cssxref("text-underline-offset")}}</li>
</ul>