Search notes:

CSS pseudo class selector :root

The :root pseudo class selector matches a document tree's root element which is the HTML element: html element in HTML documents.
Because the :root pseudo class selector has higher specifity than the html element, the text of Not within div is red rather than blue in the following example.
All font sizes are 20px:
<html>
<head>
<style>

:root {
   color: red;
}

html {
   color: blue;
   font-size: 20px
}

div {
   color: green;
}

</style>
</head>
<body>

<div>Within div</div>

Not within div

</body>
</html>
Github repository about-css, path: /selectors/pseudo-classes/root.html

See also

document.documentElement

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:51 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(51): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(66): id_of(Object(PDO), 'uri', '/notes/developm...') #2 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759415304, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #3 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/CSS/selectors/pseudo-classes/root(70): insert_webrequest() #4 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 51