HyperText Markup Language (HTML) defines color in terms of red, green and blue relationships or "RGB." Colors, as defined by HTML, are six-character values called hexadecimal codes. Computers can display over 16.7 million colors. However, HTML documents (Web pages) allow only 256 "safe" colors per document.
Bee-low are the 216 colors considered "safe" to use in Web pages. (But wait, didn't a Bee just say that Web pages display 256 colors? What about the other 40 colors? Well, it's like this: Microsoft reserves 40 colors for their Windows operating system. Nice guys, huh?)
Blue=00
Blue=33
Blue=66
Blue=99
Blue=cc
Blue=ff
Non-colors
Examples of
Use
Now a little information about hexadecimal codes. A hexadecimal code looks something like ffcc00. The first two characters (ff) represent the red value, the next two (cc) are for the green value, and the last two (00) tell the computer what amount of blue to display. The computer reads this RGB code (ffcc00) and displays the color:
ffcc00 red = ff
green = cc
blue = 00As you can see, there are thousands of hexadecimal combinations used to generate the 6.7 million+ colors on computer screens. However, the 216 "safe" colors use only the 00, 33, 66, 99, cc, and ff values. The following tables show these 216 "safe" colors with their hexadecimal codes. See bottom of this page for examples of using hexadecimal color codes in HTML. For more colors and hex codes, see Hexadecimal Coloring.
Note: This page requires a Web browser that supports color-filled table cells.
| Red | ff | ff0000 | ff3300 | ff6600 | ff9900 | ffcc00 | ffff00 |
|---|---|---|---|---|---|---|---|
| cc | cc0000 | cc3300 | cc6600 | cc9900 | cccc00 | ccff00 | |
| 99 | 990000 | 993300 | 996600 | 999900 | 99cc00 | 99ff00 | |
| 66 | 660000 | 663300 | 666600 | 669900 | 66cc00 | 66ff00 | |
| 33 | 330000 | 333300 | 336600 | 339900 | 33cc00 | 33ff00 | |
| 00 | 000000 | 003300 | 006600 | 009900 | 00cc00 | 00ff00 | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
| Red | ff | ff0033 | ff3333 | ff6633 | ff9933 | ffcc33 | ffff33 |
|---|---|---|---|---|---|---|---|
| cc | cc0033 | cc3333 | cc6633 | cc9933 | cccc33 | ccff33 | |
| 99 | 990033 | 993333 | 996633 | 999933 | 99cc33 | 99ff33 | |
| 66 | 660033 | 663333 | 666633 | 669933 | 66cc33 | 66ff33 | |
| 33 | 330033 | 333333 | 336633 | 339933 | 33cc33 | 33ff33 | |
| 00 | 000033 | 003333 | 006633 | 009933 | 00cc33 | 00ff33 | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
| Red | ff | ff0066 | ff3366 | ff6666 | ff9966 | ffcc66 | ffff66 |
|---|---|---|---|---|---|---|---|
| cc | cc0066 | cc3366 | cc6666 | cc9966 | cccc66 | ccff66 | |
| 99 | 990066 | 993366 | 996666 | 999966 | 99cc66 | 99ff66 | |
| 66 | 660066 | 663366 | 666666 | 669966 | 66cc66 | 66ff66 | |
| 33 | 330066 | 333366 | 336666 | 339966 | 33cc66 | 33ff66 | |
| 00 | 000066 | 003366 | 006666 | 009966 | 00cc66 | 00ff66 | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
| Red | ff | ff0099 | ff3399 | ff6699 | ff9999 | ffcc99 | ffff99 |
|---|---|---|---|---|---|---|---|
| cc | cc0099 | cc3399 | cc6699 | cc9999 | cccc99 | ccff99 | |
| 99 | 990099 | 993399 | 996699 | 999999 | 99cc99 | 99ff99 | |
| 66 | 660099 | 663399 | 666699 | 669999 | 66cc99 | 66ff99 | |
| 33 | 330099 | 333399 | 336699 | 339999 | 33cc99 | 33ff99 | |
| 00 | 000099 | 003399 | 006699 | 009999 | 00cc99 | 00ff99 | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
| Red | ff | ff00cc | ff33cc | ff66cc | ff99cc | ffcccc | ffffcc |
|---|---|---|---|---|---|---|---|
| cc | cc00cc | cc33cc | cc66cc | cc99cc | cccccc | ccffcc | |
| 99 | 9900cc | 9933cc | 9966cc | 9999cc | 99cccc | 99ffcc | |
| 66 | 6600cc | 6633cc | 6666cc | 6699cc | 66cccc | 66ffcc | |
| 33 | 3300cc | 3333cc | 3366cc | 3399cc | 33cccc | 33ffcc | |
| 00 | 0000cc | 0033cc | 0066cc | 0099cc | 00cccc | 00ffcc | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
| Red | ff | ff00ff | ff33ff | ff66ff | ff99ff | ffccff | ffffff |
|---|---|---|---|---|---|---|---|
| cc | cc00ff | cc33ff | cc66ff | cc99ff | ccccff | ccffff | |
| 99 | 9900ff | 9933ff | 9966ff | 9999ff | 99ccff | 99ffff | |
| 66 | 6600ff | 6633ff | 6666ff | 6699ff | 66ccff | 66ffff | |
| 33 | 3300ff | 3333ff | 3366ff | 3399ff | 33ccff | 33ffff | |
| 00 | 0000ff | 0033ff | 0066ff | 0099ff | 00ccff | 00ffff | |
|
|
00 | 33 | 66 | 99 | cc | ff | |
| Green | |||||||
|
|
000000 | 333333 | 666666 | 999999 | cccccc | ffffff | |
|---|---|---|---|---|---|---|---|
|
|
|
|
|||||
For inside the page's BODY tag set:
For setting the page's background color:
<BODY BGCOLOR="ffffff">
For setting the page's text color:
<BODY TEXT="000000">
For setting the page's hyperlink color:
<BODY LINK="00007d">
For setting the page's visited hyperlink color:
<BODY VLINK="666699">
For setting the page's active hyperlink color:
<BODY ALINK="ff0000">
Example of color settings for page's BODY tag:
<BODY BGCOLOR="ffffff" TEXT="000000" LINK="00007d" VLINK="666699" ALINK="ff0000">
Tip: Set all these color attributes in the BODY tag to avoid color conflicts.
For setting specific colors within an HTML document:
Text:
<FONT COLOR="000000">The quick brown fox.</FONT>
Tables:
Table's background color:
<TABLE BGCOLOR="333300">
Header cell within a table:
<TH BGCOLOR="ffffff">
Data cell within a table:
<TD BGCOLOR="000000">

|
|
![]() |