codescracker


html

HTML Color Codes



« Previous Tutorial Next Tutorial »


In HTML, you can specify the colors for the text and background of a Web page to make it more attractive and appealing.

HTML defines 16 widely known colors that you can apply to a Web page by specifying the name of the color as the value of the text attribute of the BODY element.

Alternately, you can use the hexadecimal (Hex) values of colors, which imply that the value of the text attribute must be the hexadecimal value of the color. You can also apply colors to a Web page by using the RGB color mode. In this case, the text attribute contains the RGB value of the color.

You can apply colors in a Web page with the help of

HTML Color Names

You can use a color in a Web page by simply specifying its name. However, there are only 16 colors that can be specified by their names. For example, you need to design a Web page, in which you want to display the text in red color. You can do so by using the text attribute of the BODY element. You can specify a color by typing the name of the color as the value of the text attribute in the BODY element.

HTML Color Hex Values

The Hex values, also referred as hexadecimal numbers, are 6 digits or three bytes number that start with the # sign. The three bytes present in every hexadecimal number represent the following :

Each byte contains some numbers from 00 to 99 and alphabets from AA to FF in hexadecimal notation.

The Hex values are defined through the combination of values assigned to red, green, and blue colors. When you use a Hex value to apply a color in an image, you can use numerals as well as alphabets. In Hex value, 0 represents the darkest color that is black and F represents the lightest color that is white. For example, the hexadecimal number for black is #000000. The first two digits (00) represent the amount of red color. The second two digits (00) represent the amount of green color, and the last two digits (00) represent the amount of blue color.

HTML Color RGB Values

The process of displaying colors by using the different combinations of red, green, and blue is known as the RGB configuration.

It is a set of three dials, where the first dial represents red, second dial represents green, and the third dial represents the blue color.

In the RGB configuration, the value of each color (red, green, and blue) ranges from 0 to 255 in decimal. The color specified by 255, 0, 0 represents the red color because its first dial contains the value 255 that represents the red color, while the second dial representing the green color and the third dial representing the blue colors contains 0 (means no color).

In the same way, the color specified by 0, 255, 0 represents the green color, and the color specified by 0, 0, 255 represents the blue color. If all the three dials are turned off, such as 0, 0, 0 then this is the condition of the absence of color or simply black color. On the other hand, if all the dials are turned on, such as 255, 255, 255 then it represents the white color.

HTML Color Names and their RGB Values

The following table provides information about the names of color and their RGB values.

Color Name RGB Value
Black rgb(0, 0, 0)
Silver rgb(192, 192, 192)
Gray rgb(128, 128, 128)
White rgb(255, 255, 255)
Maroon rgb(128, 0, 0)
Red rgb(255, 0, 0)
Purple rgb(128, 0, 128)
Fuchsia rgb(255, 0, 255)
Green rgb(0, 255, 0)
Lime rgb(0, 255, 0)
Olive rgb(128, 128, 0)
Yellow rgb(255, 255, 0)
Navy rgb(0, 0, 128)
Blue rgb(0, 0, 255)
Teal rgb(0, 128, 128)
Aqua rgb(0, 255, 255)

HTML Web-safe Colors

Earlier, a computer system is used to support only 256 colors, out of which 216 colors are Web standard colors displayed correctly by all computer systems. These colors are known as Web-safe colors that are only defined by using the values, 00, 33, 66, 99, AA, CC, or FF. A Web-safe color can use any combination of these values. For example, #99FF00 is a Web-safe color but #221144 is not a Web-safe color. The 00 represents the darkest value for each color and the FF represents the brightest value for each color.

HTML Color Values

Colors are displayed combining RED, GREEN, and BLUE light

HTML Colors with their names and HEX values

Look at the following table which lists the HTML Colors with their names and HEX Values:

Color Name HEX Value Color
Black #000000
DarkBlue #00008B
Blue #0000FF
MediumBlue #0000CD
DeepSkyBlue #00BFFF
Navy #000080
DarkGreen #006400
Green #008000
DarkCyan #008B8B
Teal #008080
MediumSpringGreen #00FA9A
DarkTurquoise #00CED1
Lime #00FF00
Aqua #00FFFF
Cyan #00FFFF
SpringGreen #00FF7F
MidnightBlue #191970
DarkSlateGray #2F4F4F
LightSeaGreen #20B2AA
DodgerBlue #1E90FF
ForestGreen #228B22
SeaGreen #2E8B57
LimeGreen #32CD32
RoyalBlue #4169E1
SteelBlue #4682B4
MediumSeaGreen #3CB371
MediumTurquoise #48D1CC
Indigo #4B0082
Turquoise #40E0D0
CadetBlue #5F9EA0
DarkSlateBlue #483D8B
DarkOliveGreen #556B2F
CornflowerBlue #6495ED
MediumAquaMarine #66CDAA
RebeccaPurple #663399
DimGray #696969
OliveDrab #6B8E23
SlateBlue #6A5ACD
MediumSlateBlue #7B68EE
SlateGray #708090
LawnGreen #7CFC00
Chartreuse #7FFF00
LightSlateGray #778899
Aquamarine #7FFFD4
Purple #800080
Olive #808000
Maroon #800000
Gray #808080
LightSkyBlue #87CEFA
SkyBlue #87CEEB
DarkRed #8B0000
BlueViolet #8A2BE2
DarkSeaGreen #8FBC8F
DarkMagenta #8B008B
SaddleBrown #8B4513
LightGreen #90EE90
DarkViolet #9400D3
MediumPurple #9370DB
PaleGreen #98FB98
YellowGreen #9ACD32
DarkOrchid #9932CC
Brown #A52A2A
Sienna #A0522D
LightBlue #ADD8E6
DarkGray #A9A9A9
GreenYellow #ADFF2F
LightSteelBlue #B0C4DE
PaleTurquoise #AFEEEE
PowderBlue #B0E0E6
DarkGoldenRod #B8860B
FireBrick #B22222
MediumOrchid #BA55D3
DarkKhaki #BDB76B
RosyBrown #BC8F8F
MediumVioletRed #C71585
Silver #C0C0C0
IndianRed #CD5C5C
Chocolate #D2691E
Peru #CD853F
LightGray #D3D3D3
Tan #D2B48C
Orchid #DA70D6
Thistle #D8BFD8
PaleVioletRed #DB7093
GoldenRod #DAA520
Crimson #DC143C
LightCyan #E0FFFF
Plum #DDA0DD
Gainsboro #DCDCDC
BurlyWood #DEB887
Lavender #E6E6FA
Violet #EE82EE
DarkSalmon #E9967A
LightCoral #F08080
PaleGoldenRod #EEE8AA
AliceBlue #F0F8FF
Khaki #F0E68C
HoneyDew #F0FFF0
Azure #F0FFFF
Wheat #F5DEB3
SandyBrown #F4A460
Beige #F5F5DC
MintCream #F5FFFA
WhiteSmoke #F5F5F5
Salmon #FA8072
GhostWhite #F8F8FF
AntiqueWhite #FAEBD7
LightGoldenRodYellow #FAFAD2
Linen #FAF0E6
OldLace #FDF5E6
Fuchsia #FF00FF
Red #FF0000
DeepPink #FF1493
Magenta #FF00FF
OrangeRed #FF4500
Tomato #FF6347
Coral #FF7F50
HotPink #FF69B4
DarkOrange #FF8C00
Pink #FFC0CB
Orange #FFA500
LightSalmon #FFA07A
LightPink #FFB6C1
Gold #FFD700
NavajoWhite #FFDEAD
PeachPuff #FFDAB9
Moccasin #FFE4B5
MistyRose #FFE4E1
Bisque #FFE4C4
BlanchedAlmond #FFEBCD
LavenderBlush #FFF0F5
PapayaWhip #FFEFD5
SeaShell #FFF5EE
FloralWhite #FFFAF0
Cornsilk #FFF8DC
LemonChiffon #FFFACD
Snow #FFFAFA
Yellow #FFFF00
White #FFFFFF
LightYellow #FFFFE0
Ivory #FFFFF0

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test