April 2005
Intermediate to advanced
336 pages
6h 33m
English
Adding color to backgrounds is extremely easy and very useful. You can add color to your page background and any element background.
Color is added to the document background by selecting the body element and using the background-color property and a color property value:
body {background-color: #999;}
Here you see I've chosen a background of dark gray to the entire body. When viewed in a browser, this turns the background color completely gray (see Figure 8-2).
Figure 8-2. Applying color to a document background.

You should always set a page background color, even ...
Read now
Unlock full access