Contact Our Development Team
Free Code Tutorials & Open Source Code
HTML Colors
Tutorials > HTML > Colors
HTML Colors
As we mentioned in the backgrounds section of our tutorials, there are three ways of specifying colors in HTML: using the color name, using the hex color code or using the RGB values of the color. Here is a list of colors for you to use:
Named Colors
The HTML specification names 16 colors which can be used by name in your HTML markup:
  Aqua Black Blue Fuchsia
Gray Green Lime Maroon
Navy Olive Purple Red
Silver Tealk White Yellow
Web-safe colors
"Web-safe colors" are a palette of 216 colors which could be displayed without dithering on 256 color displays. While these displays are almost unused now, the use of "web-safe" colors has persisted, as it is a known palette you can trust the browser to display well. For more details about web-safe colors and their uses and benefits, read the Wikipedia article which goes into more details than is necessary in this tutorial. Below is a table of the 216 websafe colors:
#0000000, 0, 0#0000330, 0, 51#0000660, 0, 102
#0000990, 0, 153#0000CC0, 0, 204#0000FF0, 0, 255
#0033000, 51, 0#0033330, 51, 51#0033660, 51, 102
#0033990, 51, 153#0033CC0, 51, 204#0033FF0, 51, 255
#0066000, 102, 0#0066330, 102, 51#0066660, 102, 102
#0066990, 102, 153#0066CC0, 102, 204#0066FF0, 102, 255
#0099000, 153, 0#0099330, 153, 51#0099660, 153, 102
#0099990, 153, 153#0099CC0, 153, 204#0099FF0, 153, 255
#00CC000, 204, 0#00CC330, 204, 51#00CC660, 204, 102
#00CC990, 204, 153#00CCCC0, 204, 204#00CCFF0, 204, 255
#00FF000, 255, 0#00FF330, 255, 51#00FF660, 255, 102
#00FF990, 255, 153#00FFCC0, 255, 204#00FFFF0, 255, 255
#33000051, 0, 0#33003351, 0, 51#33006651, 0, 102
#33009951, 0, 153#3300CC51, 0, 204#3300FF51, 0, 255
#33330051, 51, 0#33333351, 51, 51#33336651, 51, 102
#33339951, 51, 153#3333CC51, 51, 204#3333FF51, 51, 255
#33660051, 102, 0#33663351, 102, 51#33666651, 102, 102
#33669951, 102, 153#3366CC51, 102, 204#3366FF51, 102, 255
#33990051, 153, 0#33993351, 153, 51#33996651, 153, 102
#33999951, 153, 153#3399CC51, 153, 204#3399FF51, 153, 255
#33CC0051, 204, 0#33CC3351, 204, 51#33CC6651, 204, 102
#33CC9951, 204, 153#33CCCC51, 204, 204#33CCFF51, 204, 255
#33FF0051, 255, 0#33FF3351, 255, 51#33FF6651, 255, 102
#33FF9951, 255, 153#33FFCC51, 255, 204#33FFFF51, 255, 255
#660000102, 0, 0#660033102, 0, 51#660066102, 0, 102
#660099102, 0, 153#6600CC102, 0, 204#6600FF102, 0, 255
#663300102, 51, 0#663333102, 51, 51#663366102, 51, 102
#663399102, 51, 153#6633CC102, 51, 204#6633FF102, 51, 255
#666600102, 102, 0#666633102, 102, 51#666666102, 102, 102
#666699102, 102, 153#6666CC102, 102, 204#6666FF102, 102, 255
#669900102, 153, 0#669933102, 153, 51#669966102, 153, 102
#669999102, 153, 153#6699CC102, 153, 204#6699FF102, 153, 255
#66CC00102, 204, 0#66CC33102, 204, 51#66CC66102, 204, 102
#66CC99102, 204, 153#66CCCC102, 204, 204#66CCFF102, 204, 255
#66FF00102, 255, 0#66FF33102, 255, 51#66FF66102, 255, 102
#66FF99102, 255, 153#66FFCC102, 255, 204#66FFFF102, 255, 255
#990000153, 0, 0#990033153, 0, 51#990066153, 0, 102
#990099153, 0, 153#9900CC153, 0, 204#9900FF153, 0, 255
#993300153, 51, 0#993333153, 51, 51#993366153, 51, 102
#993399153, 51, 153#9933CC153, 51, 204#9933FF153, 51, 255
#996600153, 102, 0#996633153, 102, 51#996666153, 102, 102
#996699153, 102, 153#9966CC153, 102, 204#9966FF153, 102, 255
#999900153, 153, 0#999933153, 153, 51#999966153, 153, 102
#999999153, 153, 153#9999CC153, 153, 204#9999FF153, 153, 255
#99CC00153, 204, 0#99CC33153, 204, 51#99CC66153, 204, 102
#99CC99153, 204, 153#99CCCC153, 204, 204#99CCFF153, 204, 255
#99FF00153, 255, 0#99FF33153, 255, 51#99FF66153, 255, 102
#99FF99153, 255, 153#99FFCC153, 255, 204#99FFFF153, 255, 255
#CC0000204, 0, 0#CC0033204, 0, 51#CC0066204, 0, 102
#CC0099204, 0, 153#CC00CC204, 0, 204#CC00FF204, 0, 255
#CC3300204, 51, 0#CC3333204, 51, 51#CC3366204, 51, 102
#CC3399204, 51, 153#CC33CC204, 51, 204#CC33FF204, 51, 255
#CC6600204, 102, 0#CC6633204, 102, 51#CC6666204, 102, 102
#CC6699204, 102, 153#CC66CC204, 102, 204#CC66FF204, 102, 255
#CC9900204, 153, 0#CC9933204, 153, 51#CC9966204, 153, 102
#CC9999204, 153, 153#CC99CC204, 153, 204#CC99FF204, 153, 255
#CCCC00204, 204, 0#CCCC33204, 204, 51#CCCC66204, 204, 102
#CCCC99204, 204, 153#CCCCCC204, 204, 204#CCCCFF204, 204, 255
#CCFF00204, 255, 0#CCFF33204, 255, 51#CCFF66204, 255, 102
#CCFF99204, 255, 153#CCFFCC204, 255, 204#CCFFFF204, 255, 255
#FF0000255, 0, 0#FF0033255, 0, 51#FF0066255, 0, 102
#FF0099255, 0, 153#FF00CC255, 0, 204#FF00FF255, 0, 255
#FF3300255, 51, 0#FF3333255, 51, 51#FF3366255, 51, 102
#FF3399255, 51, 153#FF33CC255, 51, 204#FF33FF255, 51, 255
#FF6600255, 102, 0#FF6633255, 102, 51#FF6666255, 102, 102
#FF6699255, 102, 153#FF66CC255, 102, 204#FF66FF255, 102, 255
#FF9900255, 153, 0#FF9933255, 153, 51#FF9966255, 153, 102
#FF9999255, 153, 153#FF99CC255, 153, 204#FF99FF255, 153, 255
#FFCC00255, 204, 0#FFCC33255, 204, 51#FFCC66255, 204, 102
#FFCC99255, 204, 153#FFCCCC255, 204, 204#FFCCFF255, 204, 255
#FFFF00255, 255, 0#FFFF33255, 255, 51#FFFF66255, 255, 102
#FFFF99255, 255, 153#FFFFCC255, 255, 204#FFFFFF255, 255, 255
Help! I can't see the colors!
This is probably because you are using Firefox which is not displaying the bgcolor attribute in tables on webpages in the strict HTML doctype: We're looking at the best way to work around this and will have it fixed soon, in the mean time you might want to try Apple Safari which is nice about our indiscretions.
Page Responses
Currently there have been no responses to this page...
If you have anything to contribute to this tutorial, found a bug, or know a better way of achieving the same goal, please leave your response below.
     
Copyright ©2009, Wired IDS Ltd. | Licensed under Creative Commons Attribution Share-Alike | Load time: 0.4349 seconds