Login | Contact Us | Site Map | Resources

Other HTML Elements

Home > HTML Tutorial > HTML Colors

HTML Colors

Only 16 color names are recognized in valid HTML and CSS. The remaining colors are represented by a # sign plus 6 characters that make up a hexadecimal code.

Hexadecimal codes are formed from a combination of the primary colors: red, green and blue, or RGB. The first two digits of a hex code represent the amount of red in the color, the second two digits represent the amount of green in the color, and the third two digits represent the amount of blue in the color. The lowest value is 0 (hex 00) and the highest value is 255 (hex FF).

Hexadecimal codes can be complexing unless you study them in detail. There are approximately 16 million different colors that can be created from hexadecimal codes, only about fifteen-thousand of which will display correctly in the average browser. A standard of 256 "web safe" colors were developed years ago, and although many more colors are safe now for general use, the original 256 colors are still common.

HTML Color Names

The following is a list of the 16 color names that are recognized in valid HTML.

Color Name HEX Color
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  

216 Web Safe Colors

The following is a list of the 216 colors that were determined to be safe for use on the web (they appeared the same on all monitors). Any hexadecimal code that contains three sets of identical pairs, such as these 216 colors, can be abbreviated to 3 digits (example: #CC0000 = #C00).

#000000 #330000 #660000 #990000 #CC0000 #FF0000
#000033 #330033 #660033 #990033 #CC0033 #FF0033
#000066 #330066 #660066 #990066 #CC0066 #FF0066
#000099 #330099 #660099 #990099 #CC0099 #FF0099
#0000CC #3300CC #6600CC #9900CC #CC00CC #FF00CC
#0000FF #3300FF #6600FF #9900FF #CC00FF #FF00FF
#003300 #333300 #663300 #993300 #CC3300 #FF3300
#003333 #333333 #663333 #993333 #CC3333 #FF3333
#003366 #333366 #663366 #963366 #CC3366 #FF3366
#003399 #333399 #663399 #993399 #CC3399 #FF3399
#0033CC #3333CC #6633CC #9933CC #CC33CC #FF33CC
#0033FF #3333FF #6633FF #9933FF #CC33FF #FF33FF
#006600 #336600 #666600 #996600 #CC6600 #FF6600
#006633 #336633 #666633 #996633 #CC6633 #FF6633
#006666 #336666 #666666 #996666 #CC6666 #FF6666
#006699 #336699 #666699 #996699 #CC6699 #FF6699
#0066CC #3366CC #6666CC #9966CC #CC66CC #FF66CC
#0066FF #3366FF #6666FF #9966FF #CC66FF #FF66FF
#009900 #339900 #669900 #999900 #CC9900 #FF9900
#009933 #339933 #669933 #999933 #CC9933 #FF9933
#009966 #339966 #669966 #999966 #CC9966 #FF9966
#009999 #339999 #669999 #999999 #CC9999 #FF9999
#0099CC #3399CC #6699CC #9999CC #CC99CC #FF99CC
#0099FF #3399FF #6699FF #9999FF #CC99FF #FF99FF
#00CC00 #33CC00 #66CC00 #99CC00 #CCCC00 #FFCC00
#00CC33 #33CC33 #66CC33 #99CC33 #CCCC33 #FFCC33
#00CC66 #33CC66 #66CC66 #99CC66 #CCCC66 #FFCC66
#00CC99 #33CC99 #66CC99 #99CC99 #CCCC99 #FFCC99
#00CCCC #33CCCC #66CCCC #99CCCC #CCCCCC #FFCCCC
#00CCFF #33CCFF #66CCFF #99CCFF #CCCCFF #FFCCFF
#00FF00 #33FF00 #66FF00 #99FF00 #CCFF00 #FFFF00
#00FF33 #33FF33 #66FF33 #99FF33 #CCFF33 #FFFF33
#00FF66 #33FF66 #66FF66 #99FF66 #CCFF66 #FFFF66
#00FF99 #33FF99 #66FF99 #99FF99 #CCFF99 #FFFF99
#00FFCC #33FFCC #66FFCC #99FFCC #CCFFCC #FFFFCC
#00FFFF #33FFFF #66FFFF #99FFFF #CCFFFF #FFFFFF

Black, White & Shades of Grey

The following is a list of shades of grey between solid black and solid white.

HEX Color
#000000  
#080808  
#101010  
#181818  
#202020  
#282828  
#303030  
#383838  
#404040  
#484848  
#505050  
#585858  
#606060  
#686868  
#707070  
#787878  
#808080  
#888888  
#909090  
#989898  
#A0A0A0  
#A8A8A8  
#B0B0B0  
#B8B8B8  
#C0C0C0  
#C8C8C8  
#D0D0D0  
#D8D8D8  
#E0E0E0  
#E8E8E8  
#F0F0F0  
#F8F8F8  
#FFFFFF