O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

:root

Applies to:

The root element

Description:

This matches the document’s root element, which in HTML and XHTML is always the html element. In XML formats, the root element can have any name; thus, a generic root-element selector is needed.

Examples:

:root {font: medium serif;}
:root > * {margin: 1.5em 0;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required