HTML: the Root Element

By Xah Lee. Date: . Last updated: .

What's Root Element

“root element” of HTML is the element represented by the <html></html> tags.

Root element of XML may be other, depending on the XML. For example, root element of SVG is represented by the <svg></svg> tags.

[see Practical SVG Tutorial]

Root element of Atom Web Feed is <feed></feed>.

Why is Root Element Important

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

[see CSS: Units]

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]

∑ JS in Depth
XAH  BUY NOW

HTML Basics

HTML Table

Misc

HTML4 Frameset