Click to go back to Web Design Using Color on the Web

Color can be used to organize and classify information, to focus attention, to increase retention, to reduce search times, and to provoke an emotional response. This page presents color use guidelines and shows you how to specify and code colors.

Color Use Guidelines

Click to view codes for 216 colors
  • Use non-dithering colors; that is, for display on PCs and Macs, use only RGB combinations that use hexadecimal codes 00, 33, 66, 99, CC, or FF. See the 216-color palette (shown on the right).
  • Save images as 8-bit adaptive-palette GIF files.
  • Use a white background and black text with red and blue for highlighting.
  • If a black background is used, use white text with yellow and green for highlighting (this combination is not recommended if you expect users to print your pages).
  • Do not use more than three highlight colors.
  • Ideally, the color dominance on the screen should be white then black, red, green, yellow, and blue.
  • Use color functionally. What is the purpose of the color you are using? Are you using a unique color for different purposes? Are you using color consistently?
  • Use darker colors for dense or heavy objects.
  • Use highlight colors that have meaningful associations in your industry (for example, red: stop, danger, heat, loss; green: go, life, youth, safety; blue: inactive, cool, sky, water).
  • Avoid using blue for small objects; red in low light situations; and a highlight color for large areas of the screen. Note that red and yellow objects appear larger than green and blue ones. Use blue as a background if you want to enhance depth perception.

Specifying Your Own Colors

You can specify the color to be used for page text, background, and links. A 256-color palette is used and color is specified using a 6-digit hexadecimal code representing the Red, Green, and Blue (RGB) components of the color; the first two digits specify the red component, the second pair green, and the last pair blue. Graphical editing programs (for example, PhotoShop and Paint Shop Pro) can be set up to use a 216-color palette.

Decimal to Hexadecimal Mapping

Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F


Conversion Examples
Decimal 128 64 32 16 08 04 02 01 Type
0 0 0 0 0 0 0 0 0 Binary
0 0 Hex
51 0 0 1 1 0 0 1 1 Binary
3 3 Hex
102 0 1 1 0 0 1 1 0 Binary
6 6 Hex
153 1 0 0 1 1 0 0 1 Binary
9 9 Hex
204 1 1 0 0 1 1 0 0 Binary
C C Hex
255 1 1 1 1 1 1 1 1 Binary
F F Hex


HTML Color Coding
Element HTML Code
Background Color <BODY BGCOLOR="#xxxxxx">
Text Color <BODY TEXT="#xxxxxx"> for body text
<BODY LINK="#xxxxxx"> for unvisited links
<BODY VLINK="#xxxxxx"> for visited links
<BODY ALINK="#xxxxxx"> for activated links
Spot Color <FONT COLOR="#xxxxxx">text</font>
Table Color <TABLE BGCOLOR="#xxxxxx">
<TH BGCOLOR="#xxxxxx">
<TD BGCOLOR="#xxxxxx">