Tell a Friend About Our Cool Software

HTML provides you with control over the colors of items on your pages. There are two ways to specify a color.
The first and easiest is to simply use the color name. You can select from the following 16 keywords: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. Of course you can use this technique only if you want one of these colors.
The second way, which allows specifying any color you want, is using Hex Codes. This is the preferred way to specify colors because it is universally understood and you'll never get stuck trying to find the name for that certain shade of blue.
To use this technique you need to understand how colors on a computer screen are created. Any color is a combination of the three additive primary colors red, green, and blue. This is why you will sometimes see computer colors referred to as RGB colors. In any given color, each of the three primary colors has a value ranging from 0 (none) to 255 (maximum), so any color can be represented by its RGB value of three numbers--and this is how you can specify colors for your Web page elements. There are three formats for doing this:
Table 3-1 shows some examples of colors using the rgb() function and hexadecimal notation. You can experiment with colors using your HTML editor and browser to see what different values look like.
Table 3-1. RGB and hexadecimal codes for some colors.
| Color | rgb() | Hexadecimal |
| Black | rgb(0,0,0) | #000000 |
| White | rgb(255,255,255) | #FFFFFF |
| Medium gray | rgb(153,153,153) | #999999 |
| Blue | rgb(0,0,255) | #0000FF |
| Red | rgb(255,0,0) | #FF0000 |
| Green | rgb(0,255,0) | #00FF00 |
| Yellow | rgb(255,255,0) | #FFFF00 |
| Purple | rgb(255,0,255) | #FF00FF |
| Light blue | rgb(51,255,255) | #33FFFF |
| Pink | rgb(255,51,153) | #FF3399 |
| Brown | rgb(153,51,0) | #993300 |