|
You can set colors in your HTML document by using the color attributes
of the BODY, FONT, HR, MARQUEE, and TABLE elements. For example, you can
set background color for your document by using the BGCOLOR= attribute
with the BODY element as in the following example:
<BODY BGCOLOR=WHITE>
<P>This
page has a white background.
</BODY>
You can specify
colors in two ways: by using a color name (as in the preceding example),
or by using numbers to denote a red-green-blue color value.
Internet Explorer
supports these color names:
AQUA [#00FFFF],
BLACK [#000000], BLUE [#0000FF], FUCHSIA [#FF00FF]
GRAY [#808080],
GREEN [#008000], LIME [#00FF00], MAROON [#800000]
NAVY [#000080],
OLIVE [#808000], PURPLE [#800080], RED [#FF0000]
SILVER [#C0C0C0],
TEAL [#008080], WHITE [#FFFFFF], YELLOW [#FFFF00]
Note
This feature is not compatible with Netscape v2.0.
A red-green-blue
color value consists of three two-digit hexadecimal numbers, with each
number specifying the intensity of the corresponding color. For example,
the color value #FF0000 is red because the red number is set to its highest
value, FF (255 in the decimal, or base 10, system). Green and blue are
set to zero. Similarly, #00FF00 is green and #0000FF is blue. The pound
sign (#) is optional. In this example, a red horizontal rule is displayed
by the following HTML code:
<HR COLOR="#00FF0000">
Although red-green-blue
color values theoretically allow for many thousands of colors, the actual
number of colors available for your HTML document depends on the color
capabilities of the devices the document will be viewed on. Many personal
computers can display only 16 colors due to the type of video display adapter
they use. Always choose colors carefully, and whenever possible test your
color choices on a variety of computers. |
|