The :root pseudo-class represents an element that is the root of the document. In case of HTML, it is html element.
Example – css :root
In this example :root selector is being used to chage background color of html element (hence whole document).
<style type="text/css"> :root { background-color: lightblue; } </style> <dive>div1</div> <dive>div2</div>