This translation is incomplete. Please help translate this article from English.
Sumari
La pseudo-class CSS :root coincideix amb l'element arrel de l'arbre que representa el document. Aplicat a HTML, :root representa el element <html> i és idèntic al selector html, excepte que la seva especificitat és més gran.
Sintaxi
:root { style properties }
Exemple
El ùs de :root pot ser útil per declarar Variables CSS globals:
:root {
--main-color: hotpink;
--pane-padding: 5px 42px;
}
Especificacions
| Especificació | Estat | Comentari |
|---|---|---|
| Selectors Level 4 The definition of ':root' in that specification. |
Working Draft | Sense canvis. |
| Selectors Level 3 The definition of ':root' in that specification. |
Recommendation | Definició inicial. |
Navegadors compatibles
| Característica | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Suport bàsic | 1 | 1.0 (1.7 or earlier) | 9 | 9.5 | 1.0 |
| Característica | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Suport bàsic | ? | ? | ? | ? | ? |
Document Tags and Contributors
Tags:
Contributors to this page:
Legioinvicta
Last updated by:
Legioinvicta,