:root - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:root

Description

The :root selector selects the document's root element, the html element.

Example

Select HTML element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
:root {<!--from   w  w w  . java2s  .  c  o m-->
    background: #ff0000;
}
</style>
</head>
<body>

<h1>This is a heading</h1>

</body>
</html>

Related Tutorials