HTML: the Root Element

By Xah Lee. Date: . Last updated: .

What is Root Element

Why is Root Element Important

It's important because many CSS's meaning refers to it.

For example:

CSS Syntax for Root Element

In CSS, the root can be specified by:

:root

For example, make all text red:

:root { color: red; }

This is often used when using CSS variables.

〔see CSS: Variable (Custom Property)