Setting Text and Background Colors
Before specifing how to change the colors, we need to ask what the colors are and how are they formed. Colors can be specified in two ways, either as on of 16 names or a hexidecimal (base 16) mix of red, green and blue (RGB).
Color Names
The color names are:
- Black
- Blue
- Cyan
- Fuchsia
- Gray
- Green
- Lime
- Maroon
- Olive
- Orange
- Purple
- Red
- Silver
- Teal
- White (white)
- Yellow (yellow)
Colors can also be specified as a 6 digit hexidecimal number. The base 10 numbers 0 - 255 can be specified as as two hex digits ranging from 0016 - FF16 in red, green and blue mixtures. The number #000000 is black (no color) while #ffffff is white (all color). The hex value #00ff00 would green.
Note: Hex colors are usually specified with a leading #.
For more information on hex colors, color names, etc see:
If you would like to dynamically play with color combinations, see
http://WWW.MATCMP.SUNYNASSAU.EDU/~glassr/html/colorsf.htm but first read the section below on where you can change colors.
Changing Colors
Color schemes can be changed globally for the entire document in the <BODY> tag for the following items.
- TEXT
- all the text on a page.
- BGCOLOR
- the background color.
- LINK
- A hypertext link that has not been visited.
- VLINK
- The color of a hypertext link after you have visted it.
- ALINK
- Active link. That color that breifly shows up when you clikck on a hypertext link.
Example: This document has has the following BODY statement.
<BODY BGCOLOR="beige" TEXT="navy">
The syntax is:
<BODY TEXT=color BGCOLOR=color LINK=color VLINK=color ALINK=color>
where color can be a color name or hex value
and any of the 5 items are optional.
The color of particular text within the document can be changed by using the <FONT COLOR=color> </FONT> container. Again, color can be a color name or hex value.
Example: The heading of this section is the following:
<H2><FONT COLOR="#400000">Changing Colors</FONT></H2>
Example: The start of the prior paragraph above is:
<P><font size="+2" color="#008080">T</font>he color of