CSS3 :rootSelectors

Complete CSS Selector Reference Manual

Example

Set the background color of the HTML document:

:root { background:#ff0000; }

Try it Yourself »

Definition and Usage

The :root selector matches the root element of the document.

In HTML, the root element is always the HTML element.

Browser Support

The numbers in the table indicate the first browser version number that supports the property.

Selectors
:root 4.0 9.0 3.5 3.2 9.6

Complete CSS Selector Reference Manual

other extensions