Search notes:

CSS: Root element/canvas - Styles for body with and without styles for html element

body-with-html.html

This document specifies a background color for both the <html> and the <body> tag. The background color for the body is only used where the canvas is occupied:
<!DOCTYPE html>
<html<head><style>
  
  html {background-color: #e7ffe7; }
  body {background-color: #f0f0ff; width: 20em; padding: 0.4em; margin: 0}

</style></head><body>

  This document defines a greenish background for the <i>body</i> which is used to color the canvas which is not
  occupied by another element
 <br>
  The color of the body is only used for parts where other html elements cover the canvas.
    <p>
  Go to <a href='body-without-html.html'>Body without html</a>

</body></html>
Github repository about-CSS, path: /root-element/canvas/body-with-and-without-html/body-with-html.html

body-without-html.html

In contrast, this document specifies a background color only for the <body> element.
In this case, the body's background color is used to paint the entire canvas:
<!DOCTYPE html>
<html<head><style>
  
  body {background-color: #f0f0ff; width: 20em; margin: 0.4em }

</style></head><body>

  This document defines a bluish background for the <i>body</i>
 <br>
  Since no value for the <i>html</i> element is defined, the body's
  color is used for the entire canvas.
  <p>
  Go to <a href='body-with-html.html'>document that defines background colors for the body and html element</a>.

</body></html>
Github repository about-CSS, path: /root-element/canvas/body-with-and-without-html/body-without-html.html

See also

Experiment with the html and body tag

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:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759561999, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/CSS/root-element/canvas/body-with-and-without-html(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78