Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS3 :root selector

CSS3 :root selector

Complete CSS SelectorComplete 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

Complete CSS SelectorComplete CSS Selector Reference Manual