CSS3 :root selector
Complete CSS Selector Reference Manual
Example
Set the background color of an HTML document:
:root
{
background:
#ff0000
;
}
Try it »
Definition and Usage
:root selector matches the root element of a document.
In HTML the root element is always the html element.
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Selector | |||||
|---|---|---|---|---|---|
| :root | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |