CSS :root Selector
Description
The :root pseudo-class represents an element that is the root of the document. In HTML 4, this is always the HTML element.
Syntax
:root { css declarations; }
Example
:root { color: #3366ff; background: #ffff99; }
Give it a Try
Click the button below to experiment with this selector.
Browser Support
3.5![]() |
9.0![]() |
4.0![]() |
3.2![]() |
9.6![]() |