-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
61 lines (43 loc) · 1.54 KB
/
index.md
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
---
title: initial
slug: Web/CSS/initial
---
{{CSSRef}}
Le mot-clé **`initial`** applique la valeur initiale d'une propriété à un élément. La valeur initiale est fournie par le navigateur et peut être utilisée pour chaque propriété CSS. Cette propriété prendra alors [la valeur initiale](/fr/docs/Web/CSS/Valeur_initiale) spécifiée pour cette la propriété.
La propriété {{cssxref("all")}} peut être utilisée avec cette valeur afin de réinitialiser l'ensemble des propriétés CSS.
> [!NOTE]
> Pour [les propriétés héritées](/fr/docs/Web/CSS/Héritage#Propriétés_héritées), la valeur initiale peut donner des résultats étranges et mieux vaudra utiliser les mots-clés {{cssxref("inherit")}}, {{cssxref("unset")}} ou {{cssxref("revert")}}. Attention également à ne pas confondre la valeur initiale avec la valeur décrite dans la feuille de style portée par le navigateur.
## Exemples
### CSS
```css
/* On écrit le texte en rouge */
.exemple {
color: red;
}
/* Et on veut que le texte mis en avant
prenne la valeur initiale de
color */
.exemple em {
color: initial;
}
```
### HTML
```html
<p class="exemple">
Texte rouge
<em> ce texte est avec la couleur initiale (noire) </em>
ce texte est rouge aussi
</p>
```
### Résultat
{{EmbedLiveSample("Exemples")}}
## Spécifications
{{Specifications}}
## Compatibilité des navigateurs
{{Compat}}
## Voir aussi
- [La notion de valeur initiale](/fr/docs/Web/CSS/Valeur_initiale)
- {{cssxref("inherit")}}
- {{cssxref("unset")}}
- {{cssxref("revert")}}
- {{cssxref("all")}}