HTML Color


Colors are very important to give a good look and feel to your website. You can specify colors on page level using <body> tag or you can set colors for individual tags using bgcolor attribute.

The <body> tag has following attributes which can be used to set different colors:

  • bgcolor - sets a color for the background of the page.
  • text - sets a color for the body text.
  • alink - sets a color for active links or selected links.
  • link - sets a color for linked text.
  • vlink - sets a color for visited links - that is, for linked text that you have already clicked on.

HTML Color Coding Methods

There are following three different methods to set colors in your web page


Color Name

You can sepecify direct a color name to set text or background color.

AliceBlue DarkOliveGreen Indigo MediumPurple
AntiqueWhite DarkOrange Ivory Red
Aqua DarkOrchid Khaki RosyBrown
AquaMarine DarkRed Lavender RoyalBlue
Azure DarkSalmon LavenderBlush SaddleBrown
Beige DarkSeaGreen LawnGreen Salmon
Bisque DarkSlateBlue LemonChiffon SandyBrown
Black DarkSlateGray LightBlue SeaGreen
BlanchedAlmond DarkTurquoise LightCoral SeaShell
Blue DarkViolet LightCyan Sienna

View a complete list of HTML Color Name.


Color Code

A hexadecimal is a 6 digit representation of a color. The first two digits (RR) represent a red value, the next two are a green value (GG), and the last are the blue value (BB).

Each hexadecimal code will be preceded by a pound or hash sign #

You can sepecify direct a color code to set text or background color.

#003300 #003333 #003366 #003399
#006600 #006633 #006666 #006699
#009900 #009933 #009966 #009999
#00CC00 #00CC33 #00CC66 #00CC99
#FF4AFF #DD75DD #C269FE #AE70ED
#800080 #872187 #9A03FE #892EE4
#EEEEFF #ECF4FF #F9FDFF #E6FCFF
#336600 #336633 #336666 #336699
#339900 #339933 #339966 #339999
#660000 #660033 #660066 #660099

View a complete list of HTML Color Code.


Colors - RGB Values

This color value is specified using the rgb( ) property. This property takes three values, one each for red , green and blue. The value can be an integer between 0 and 255 or a percentage.

Color RED GREEN BLUE
176 23 31
220 20 60
255 182 193
255 174 185
238 162 173
205 140 149
139 95 101
255 192 203
255 181 197
238 169 184

View a complete list of HTML Color RGB Values.


Share this article on