aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/css/_colon_root
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/fr/web/css/_colon_root
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/fr/web/css/_colon_root')
-rw-r--r--files/fr/web/css/_colon_root/index.html62
1 files changed, 62 insertions, 0 deletions
diff --git a/files/fr/web/css/_colon_root/index.html b/files/fr/web/css/_colon_root/index.html
new file mode 100644
index 0000000000..cdfe0ca96f
--- /dev/null
+++ b/files/fr/web/css/_colon_root/index.html
@@ -0,0 +1,62 @@
+---
+title: ':root'
+slug: 'Web/CSS/:root'
+tags:
+ - CSS
+ - Pseudo-classe
+ - Reference
+translation_of: 'Web/CSS/:root'
+---
+<div>{{CSSRef}}</div>
+
+<p>La <a href="/fr/docs/Web/CSS/Pseudo-classes">pseudo-classe</a> <strong><code>:root</code></strong> permet de cibler la racine de l'arbre représentant le document. Pour un document HTML, <code>:root</code> ciblera donc l'élément {{HTMLElement("html")}} et aura le même comportement que le sélecteur <code>html</code> mais <a href="/fr/Apprendre/CSS/Introduction_à_CSS/La_cascade_et_l_héritage#Le_poids_des_sélecteurs">sa spécificité</a> sera plus forte.</p>
+
+<pre class="brush: css no-line-numbers">/* Sélectionne l'élément racine du document */
+/* Pour un document HTML, c'est &lt;html&gt; */
+:root {
+ background: yellow;
+}</pre>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Exemples">Exemples</h2>
+
+<p><code>:root</code> peut être utile lorsqu'on déclare <a href="/fr/docs/Web/CSS/--*">des propriétés CSS personnalisées globales</a> :</p>
+
+<pre class="brush: css">:root {
+ --main-color: hotpink;
+ --pane-padding: 5px 42px;
+}
+</pre>
+
+<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 Selectors', '#root-pseudo', ':root')}}</td>
+ <td>{{Spec2('CSS4 Selectors')}}</td>
+ <td>Aucune modification.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Selectors', '#root-pseudo', ':root')}}</td>
+ <td>{{Spec2('CSS3 Selectors')}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p class="hidden">Pour contribuer à ces données de compatibilité, vous pouvez envoyer une <em>pull request</em> sur ce dépôt: <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</p>
+
+<p>{{Compat("css.selectors.root")}}</p>