This is accomplished using attributes of the <BODY> tag. HTML authors who are unfamiliar with the <BODY> tag need to know that the <BODY>...</BODY> tags should enclose everything in the document except for the <TITLE> tag at the beginning. (The <TITLE> tag should be enclosed in a <HEAD> tag, although this is optional. For further details about the proper syntax of an HTML page, consult the w3 consortium web pages <URL:http://www.w3.org/>.)
The following short HTML document makes extensive use of this feature. Try pasting this HTML into a file and opening it with your web browser.
<HEAD> <TITLE>Color Test</TITLE> </HEAD> <BODY BGCOLOR="FFFFFF" TEXT="000000" LINK="00FF00" VLINK="CC33FF" ALINK="FF0000"> <H1>Color Test</H1> <P> This page contains black text on a white background. <a href="http://www.boutell.com/">Links</a> are displayed in green. Once visited, links are displayed in yellow. When active, links are be displayed in red. </BODY>The BGCOLOR attribute sets the background color. The TEXT attribute sets the text color. The LINK attribute sets the color for links. The VLINK attribute sets the color for links you have already visited, and the ALINK attribute sets the color for links that are active at that moment.
Fortunately, you don't need to understand that. Just use Doug Jacobson's RGB Hex Triplet Color Chart <URL:http://www.phoenix.net/~jacobson/rgb.html>, which provides the appropriate values for lots of nifty colors.
Please note: if your page is difficult to read, people will not read it. Please use the background attributes tastefully unless it is your intention to alienate your readership.
<BODY BACKGROUND="tile.gif" BGCOLOR="FFFFFF">
displays the contents of the image file tile.gif
as its background. If the user prefers not to load images,
which is quite common, then the BGCOLOR attribute is
used instead (see above). It is important to set a
reasonable BGCOLOR as an alternative to your BACKGROUND
attribute.
A library of background images, icons and replacements for the normal <HR> tag is also available. <URL:http://jupiter.ufr924.jussieu.fr:1998/nabil.html>