Style the document's root element with CSS

CSSWeb DevelopmentFront End Technology

To style document’s root element, use the CSS: root selector.

Example

You can try to run the following code to implement the: root Selector

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         :root {
            background: blue;
            color: white;
         }
      </style>
   </head>
   <body>
      <h1>Heading</h1>
      <p>This is demo text.</p>
   </body>
</html>
raja
Published on 09-May-2018 08:28:14
Advertisements