CSS: Selector: Match Root Element
Match Root Element (Element with No Parent)
:root
-
Match the HTML: the Root Element .
/* make all text red */ :root { color: red; }
This is often used when using CSS Variable .
CSS, Selectors
- CSS: Selector Tutorial
- CSS: Selector: Match Tag Name
- CSS: Selector: Match Attribute
- CSS: Selector: Match Root Element
- CSS: Selector: Match Parent
- CSS: Selector: Match Children
- CSS: Selector: Match Sibling
- CSS: Pseudo-Class Selectors
- CSS: Pseudo-Element Selectors
- CSS: Selector Negation
- CSS: Selector Syntax Shortcuts