• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Colors > Setting the Background of the Canvas

Setting the Background of the Canvas

Sometimes, you need to specify the background color of the window; for example, if the document is so short that it doesn’t fill the entire window.

The window (or viewport, as the CSS2 specification calls it since it could also refer to paper if the document is printed) does not correspond to any element in the document. Hence, its color has to come from somewhere else. The background of the window will be the same as the background of the root element. In HTML, the HTML element is always the root element, but XML-based documents will have other root elements. Because it’s common to set backgrounds on the BODY element in HTML, the BODY element serves the role of the root element if the background of the HTML element is transparent.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint