From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- files/ca/web/css/_colon_root/index.html | 112 ++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 files/ca/web/css/_colon_root/index.html (limited to 'files/ca/web/css/_colon_root') diff --git a/files/ca/web/css/_colon_root/index.html b/files/ca/web/css/_colon_root/index.html new file mode 100644 index 0000000000..072802e541 --- /dev/null +++ b/files/ca/web/css/_colon_root/index.html @@ -0,0 +1,112 @@ +--- +title: ':root' +slug: 'Web/CSS/:root' +tags: + - CSS + - Layout + - NeedsMobileBrowserCompatibility + - Pseudo-class + - Reference + - Web +translation_of: 'Web/CSS/:root' +--- +
{{CSSRef}}
+ +

La pseudo-class CSS :root coincideix amb l'element arrel de l'arbre que representa el document. En HTML, :root representa l'element {{HTMLElement("html")}} i és idèntic al selector html, excepte que la seva Especificitat és més alta.

+ +
/*  Selecciona l'element arrel del document: <html> en el cas de l'HTML */
+:root {
+  background: yellow;
+}
+ +

Sintaxi

+ +
{{csssyntax}}
+ +

Exemple

+ +

El ùs de :root pot ser útil per declarar Variables CSS globals:

+ +
:root {
+  --main-color: hotpink;
+  --pane-padding: 5px 42px;
+}
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentari
{{SpecName('CSS4 Selectors', '#root-pseudo', ':root')}}{{Spec2('CSS4 Selectors')}}Sense canvis.
{{SpecName('CSS3 Selectors', '#root-pseudo', ':root')}}{{Spec2('CSS3 Selectors')}}Definició inicial.
+ + + +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
DescripcióChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic1{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.7")}}99.51.0
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
DescripcióAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
-- cgit v1.2.3-54-g00ecf