HTML Color Codes are an important part that you need to know when doing the web design and development process. Using these codes, you can define colors for various visual elements more precisely and consistently.
For web developers, designers, and anyone who creates digital content, this code is almost inseparable from everyday work. Whether it’s creating an HTML website, designing images, or working on a presentation, your work can be more professional by understanding this color code.
No need to look far, because we have prepared a list of HTML color codes in this article that you can use as a guide. We will also explain the types of digital colors that exist today, as well as share examples of their use.
HTML and CSS Color Codes List
Below is a complete table listing all HTML color codes along with their associated HEX and RGB colors:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
Black | #000000 | rgb(0, 0, 0) | |
White | #FFFFFF | rgb(255, 255, 255) | |
Red | #FF0000 | rgb(255, 0, 0) | |
Lime | #00FF00 | rgb(0, 255, 0) | |
Blue | #0000FF | rgb(0, 0, 255) | |
AliceBlue | #F0F8FF | rgb(240, 248, 255) | |
AntiqueWhite | #FAEBD7 | rgb(250, 235, 215) | |
Aqua | #00FFFF | rgb(0, 255, 255) | |
Aquamarine | #7FFFD4 | rgb(127, 255, 212) | |
Azure | #F0FFFF | rgb(240, 255, 255) | |
Beige | #F5F5DC | rgb(245, 245, 220) | |
Bisque | #FFE4C4 | rgb(255, 228, 196) | |
BlanchedAlmond | #FFEBCD | rgb(255, 235, 205) | |
BlueViolet | #8A2BE2 | rgb(138, 43, 226) | |
Brown | #A52A2A | rgb(165, 42, 42) | |
BurlyWood | #DEB887 | rgb(222, 184, 135) | |
CadetBlue | #5F9EA0 | rgb(95, 158, 160) | |
Chartreuse | #7FFF00 | rgb(127, 255, 0) | |
Chocolate | #D2691E | rgb(210, 105, 30) | |
Coral | #FF7F50 | rgb(255, 127, 80) | |
CornflowerBlue | #6495ED | rgb(100, 149, 237) | |
Cornsilk | #FFF8DC | rgb(255, 248, 220) | |
Crimson | #DC143C | rgb(220, 20, 60) | |
Cyan | #00FFFF | rgb(0, 255, 255) | |
DarkBlue | #00008B | rgb(0, 0, 139) | |
DarkCyan | #008B8B | rgb(0, 139, 139) | |
DarkGoldenRod | #B8860B | rgb(184, 134, 11) | |
DarkGray | #A9A9A9 | rgb(169, 169, 169) | |
DarkGreen | #006400 | rgb(0, 100, 0) | |
DarkKhaki | #BDB76B | rgb(189, 183, 107) | |
DarkMagenta | #8B008B | rgb(139, 0, 139) | |
DarkOliveGreen | #556B2F | rgb(85, 107, 47) | |
DarkOrange | #FF8C00 | rgb(255, 140, 0) | |
DarkOrchid | #9932CC | rgb(153, 50, 204) | |
DarkRed | #8B0000 | rgb(139, 0, 0) | |
DarkSalmon | #E9967A | rgb(233, 150, 122) | |
DarkSeaGreen | #8FBC8F | rgb(143, 188, 143) | |
DarkSlateBlue | #483D8B | rgb(72, 61, 139) | |
DarkSlateGray | #2F4F4F | rgb(47, 79, 79) | |
DarkTurquoise | #00CED1 | rgb(0, 206, 209) | |
DarkViolet | #9400D3 | rgb(148, 0, 211) | |
DeepPink | #FF1493 | rgb(255, 20, 147) | |
DeepSkyBlue | #00BFFF | rgb(0, 191, 255) | |
DimGray | #696969 | rgb(105, 105, 105) | |
DodgerBlue | #1E90FF | rgb(30, 144, 255) | |
FireBrick | #B22222 | rgb(178, 34, 34) | |
FloralWhite | #FFFAF0 | rgb(255, 250, 240) | |
ForestGreen | #228B22 | rgb(34, 139, 34) | |
Fuchsia | #FF00FF | rgb(255, 0, 255) | |
Gainsboro | #DCDCDC | rgb(220, 220, 220) | |
GhostWhite | #F8F8FF | rgb(248, 248, 255) | |
Gold | #FFD700 | rgb(255, 215, 0) | |
GoldenRod | #DAA520 | rgb(218, 165, 32) | |
Gray | #808080 | rgb(128, 128, 128) | |
Green | #008000 | rgb(0, 128, 0) | |
GreenYellow | #ADFF2F | rgb(173, 255, 47) | |
HoneyDew | #F0FFF0 | rgb(240, 255, 240) | |
HotPink | #FF69B4 | rgb(255, 105, 180) | |
IndianRed | #CD5C5C | rgb(205, 92, 92) | |
Indigo | #4B0082 | rgb(75, 0, 130) | |
Ivory | #FFFFF0 | rgb(255, 255, 240) | |
Khaki | #F0E68C | rgb(240, 230, 140) | |
Lavender | #E6E6FA | rgb(230, 230, 250) | |
LavenderBlush | #FFF0F5 | rgb(255, 240, 245) | |
LawnGreen | #7CFC00 | rgb(124, 252, 0) | |
LemonChiffon | #FFFACD | rgb(255, 250, 205) | |
LightBlue | #ADD8E6 | rgb(173, 216, 230) | |
LightCoral | #F08080 | rgb(240, 128, 128) | |
LightCyan | #E0FFFF | rgb(224, 255, 255) | |
LightGoldenRodYellow | #FAFAD2 | rgb(250, 250, 210) | |
LightGray | #D3D3D3 | rgb(211, 211, 211) | |
LightGreen | #90EE90 | rgb(144, 238, 144) | |
LightPink | #FFB6C1 | rgb(255, 182, 193) | |
LightSalmon | #FFA07A | rgb(255, 160, 122) | |
LightSeaGreen | #20B2AA | rgb(32, 178, 170) | |
LightSkyBlue | #87CEFA | rgb(135, 206, 250) | |
LightSlateGray | #778899 | rgb(119, 136, 153) | |
LightSteelBlue | #B0C4DE | rgb(176, 196, 222) | |
LightYellow | #FFFFE0 | rgb(255, 255, 224) | |
LimeGreen | #32CD32 | rgb(50, 205, 50) | |
Linen | #FAF0E6 | rgb(250, 240, 230) | |
Magenta | #FF00FF | rgb(255, 0, 255) | |
Maroon | #800000 | rgb(128, 0, 0) | |
MediumAquamarine | #66CDAA | rgb(102, 205, 170) | |
MediumBlue | #0000CD | rgb(0, 0, 205) | |
MediumOrchid | #BA55D3 | rgb(186, 85, 211) | |
MediumPurple | #9370DB | rgb(147, 112, 219) | |
MediumSeaGreen | #3CB371 | rgb(60, 179, 113) | |
MediumSlateBlue | #7B68EE | rgb(123, 104, 238) | |
MediumSpringGreen | #00FA9A | rgb(0, 250, 154) | |
MediumTurquoise | #48D1CC | rgb(72, 209, 204) | |
MediumVioletRed | #C71585 | rgb(199, 21, 133) | |
MidnightBlue | #191970 | rgb(25, 25, 112) | |
MintCream | #F5FFFA | rgb(245, 255, 250) | |
MistyRose | #FFE4E1 | rgb(255, 228, 225) | |
Moccasin | #FFE4B5 | rgb(255, 228, 181) | |
NavajoWhite | #FFDEAD | rgb(255, 222, 173) | |
Navy | #000080 | rgb(0, 0, 128) | |
OldLace | #FDF5E6 | rgb(253, 245, 230) | |
Olive | #808000 | rgb(128, 128, 0) | |
OliveDrab | #6B8E23 | rgb(107, 142, 35) | |
Orange | #FFA500 | rgb(255, 165, 0) | |
OrangeRed | #FF4500 | rgb(255, 69, 0) | |
Orchid | #DA70D6 | rgb(218, 112, 214) | |
PaleGoldenRod | #EEE8AA | rgb(238, 232, 170) | |
PaleGreen | #98FB98 | rgb(152, 251, 152) | |
PaleTurquoise | #AFEEEE | rgb(175, 238, 238) | |
PaleVioletRed | #DB7093 | rgb(219, 112, 147) | |
PapayaWhip | #FFEFD5 | rgb(255, 239, 213) | |
PeachPuff | #FFDAB9 | rgb(255, 218, 185) | |
Peru | #CD853F | rgb(205, 133, 63) | |
Pink | #FFC0CB | rgb(255, 192, 203) | |
Plum | #DDA0DD | rgb(221, 160, 221) | |
PowderBlue | #B0E0E6 | rgb(176, 224, 230) | |
Purple | #800080 | rgb(128, 0, 128) | |
RosyBrown | #BC8F8F | rgb(188, 143, 143) | |
RoyalBlue | #4169E1 | rgb(65, 105, 225) | |
SaddleBrown | #8B4513 | rgb(139, 69, 19) | |
Salmon | #FA8072 | rgb(250, 128, 114) | |
SandyBrown | #F4A460 | rgb(244, 164, 96) | |
SeaGreen | #2E8B57 | rgb(46, 139, 87) | |
SeaShell | #FFF5EE | rgb(255, 245, 238) | |
Sienna | #A0522D | rgb(160, 82, 45) | |
Silver | #C0C0C0 | rgb(192, 192, 192) | |
SkyBlue | #87CEEB | rgb(135, 206, 235) | |
SlateBlue | #6A5ACD | rgb(106, 90, 205) | |
SlateGray | #708090 | rgb(112, 128, 144) | |
Snow | #FFFAFA | rgb(255, 250, 250) | |
SpringGreen | #00FF7F | rgb(0, 255, 127) | |
SteelBlue | #4682B4 | rgb(70, 130, 180) | |
Tan | #D2B48C | rgb(210, 180, 140) | |
Teal | #008080 | rgb(0, 128, 128) | |
Thistle | #D8BFD8 | rgb(216, 191, 216) | |
Tomato | #FF6347 | rgb(255, 99, 71) | |
Turquoise | #40E0D0 | rgb(64, 224, 208) | |
Violet | #EE82EE | rgb(238, 130, 238) | |
Wheat | #F5DEB3 | rgb(245, 222, 179) | |
WhiteSmoke | #F5F5F5 | rgb(245, 245, 245) | |
Yellow | #FFFF00 | rgb(255, 255, 0) | |
YellowGreen | #9ACD32 | rgb(154, 205, 50) |
Red and Pink Color Variations
Here are some variations of the HTML red color that you can use:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
IndianRed | #CD5C5C | 205, 92, 92 | |
LightCoral | #F08080 | 240, 128, 128 | |
Salmon | #FA8072 | 250, 128, 114 | |
DarkSalmon | #E9967A | 233, 150, 122 | |
LightSalmon | #FFA07A | 255, 160, 122 | |
Crimson | #DC143C | 220, 20, 60 | |
Red | #FF0000 | 255, 0, 0 | |
Firebrick | #B22222 | 178, 34, 34 | |
DarkRed | #8B0000 | 139, 0, 0 | |
Maroon | #800000 | 128, 0, 0 | |
Pink | #FFC0CB | 255, 192, 203 | |
LightPink | #FFB6C1 | 255, 182, 193 | |
HotPink | #FF69B4 | 255, 105, 180 | |
DeepPink | #FF1493 | 255, 20, 147 | |
MediumVioletRed | #C71585 | 199, 21, 133 | |
PaleVioletRed | #DB7093 | 219, 112, 147 |
Yellow and Orange Color Variations
If you need the yellow color variations, here are the codes you can use:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
Gold | #FFD700 | 255, 215, 0 | |
Yellow | #FFFF00 | 255, 255, 0 | |
LightYellow | #FFFFE0 | 255, 255, 224 | |
LemonChiffon | #FFFACD | 255, 250, 205 | |
LightGoldenrodYellow | #FAFAD2 | 250, 250, 210 | |
PapayaWhip | #FFEFD5 | 255, 239, 213 | |
Moccasin | #FFE4B5 | 255, 228, 181 | |
PeachPuff | #FFDAB9 | 255, 218, 185 | |
PaleGoldenrod | #EEE8AA | 238, 232, 170 | |
Khaki | #F0E68C | 240, 230, 140 | |
DarkKhaki | #BDB76B | 189, 183, 107 | |
Coral | #FF7F50 | 255, 127, 80 | |
Tomato | #FF6347 | 255, 99, 71 | |
OrangeRed | #FF4500 | 255, 69, 0 | |
DarkOrange | #FF8C00 | 255, 140, 0 | |
Orange | #FFA500 | 255, 165, 0 |
Green Color Variations
For green color variations, here are the codes:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
GreenYellow | #ADFF2F | 173, 255, 47 | |
Chartreuse | #7FFF00 | 127, 255, 0 | |
LawnGreen | #7CFC00 | 124, 252, 0 | |
Lime | #00FF00 | 0, 255, 0 | |
LimeGreen | #32CD32 | 50, 205, 50 | |
PaleGreen | #98FB98 | 152, 251, 152 | |
LightGreen | #90EE90 | 144, 238, 144 | |
MediumSpringGreen | #00FA9A | 0, 250, 154 | |
SpringGreen | #00FF7F | 0, 255, 127 | |
MediumSeaGreen | #3CB371 | 60, 179, 113 | |
SeaGreen | #2E8B57 | 46, 139, 87 | |
ForestGreen | #228B22 | 34, 139, 34 | |
Green | #008000 | 0, 128, 0 | |
DarkGreen | #006400 | 0, 100, 0 | |
YellowGreen | #9ACD32 | 154, 205, 50 | |
OliveDrab | #6B8E23 | 107, 142, 35 | |
Olive | #808000 | 128, 128, 0 | |
DarkOliveGreen | #556B2F | 85, 107, 47 | |
MediumAquamarine | #66CDAA | 102, 205, 170 | |
DarkSeaGreen | #8FBC8F | 143, 188, 143 | |
LightSeaGreen | #20B2AA | 32, 178, 170 | |
Aquamarine | #7FFFD4 | 127, 255, 212 |
Blue Color Variations
Here is a list of blue color variations and the HTML codes you can use:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
DarkCyan | #008B8B | 0, 139, 139 | |
Teal | #008080 | 0, 128, 128 | |
Aqua | #00FFFF | 0, 255, 255 | |
LightCyan | #E0FFFF | 224, 255, 255 | |
PaleTurquoise | #AFEEEE | 175, 238, 238 | |
Turquoise | #40E0D0 | 64, 224, 208 | |
MediumTurquoise | #48D1CC | 72, 209, 204 | |
DarkTurquoise | #00CED1 | 0, 206, 209 | |
CadetBlue | #5F9EA0 | 95, 158, 160 | |
SteelBlue | #4682B4 | 70, 130, 180 | |
LightSteelBlue | #B0C4DE | 176, 196, 222 | |
PowderBlue | #B0E0E6 | 176, 224, 230 | |
LightBlue | #ADD8E6 | 173, 216, 230 | |
SkyBlue | #87CEEB | 135, 206, 235 | |
LightSkyBlue | #87CEFA | 135, 206, 250 | |
DeepSkyBlue | #00BFFF | 0, 191, 255 | |
DodgerBlue | #1E90FF | 30, 144, 255 | |
CornflowerBlue | #6495ED | 100, 149, 237 | |
MediumSlateBlue | #7B68EE | 123, 104, 238 | |
RoyalBlue | #4169E1 | 65, 105, 225 | |
Blue | #0000FF | 0, 0, 255 | |
MediumBlue | #0000CD | 0, 0, 205 | |
DarkBlue | #00008B | 0, 0, 139 | |
Navy | #000080 | 0, 0, 128 | |
MidnightBlue | #191970 | 25, 25, 112 |
Purple Color Variations
Here are the purple color variations and their codes:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
Lavender | #E6E6FA | 230, 230, 250 | |
Thistle | #D8BFD8 | 216, 191, 216 | |
Plum | #DDA0DD | 221, 160, 221 | |
Violet | #EE82EE | 238, 130, 238 | |
Orchid | #DA70D6 | 218, 112, 214 | |
Fuchsia | #FF00FF | 255, 0, 255 | |
Magenta | #FF00FF | 255, 0, 255 | |
MediumOrchid | #BA55D3 | 186, 85, 211 | |
MediumPurple | #9370DB | 147, 112, 219 | |
BlueViolet | #8A2BE2 | 138, 43, 226 | |
DarkViolet | #9400D3 | 148, 0, 211 | |
DarkOrchid | #9932CC | 153, 50, 204 | |
DarkMagenta | #8B008B | 139, 0, 139 | |
Purple | #800080 | 128, 0, 128 | |
Indigo | #4B0082 | 75, 0, 130 | |
SlateBlue | #6A5ACD | 106, 90, 205 | |
DarkSlateBlue | #483D8B | 72, 61, 139 |
Brown Color Variations
For brown color variations, here is the HTML code that can be used:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
Cornsilk | #FFF8DC | 255, 248, 220 | |
BlanchedAlmond | #FFEBBD | 255, 235, 205 | |
Bisque | #FFE4C4 | 255, 228, 196 | |
NavajoWhite | #FFDEAD | 255, 222, 173 | |
Wheat | #F5DEB3 | 245, 222, 179 | |
BurlyWood | #DEB887 | 222, 184, 135 | |
Tan | #D2B48C | 210, 180, 140 | |
RosyBrown | #BC8F8F | 188, 143, 143 | |
SandyBrown | #F4A460 | 244, 164, 96 | |
Goldenrod | #DAA520 | 218, 165, 32 | |
DarkGoldenrod | #B8860B | 184, 134, 11 | |
Peru | #CD853F | 205, 133, 63 | |
Chocolate | #D2691E | 210, 105, 30 | |
SaddleBrown | #8B4513 | 139, 69, 19 | |
Sienna | #A0522D | 160, 82, 45 | |
Brown | #A52A2A | 165, 42, 42 |
Bright White Color Variations
Below is the HTML code for the white color variations:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
White | #FFFFFF | 255, 255, 255 | |
Snow | #FFFAFA | 255, 250, 250 | |
Honeydew | #F0FFF0 | 240, 255, 240 | |
MintCream | #F5FFFA | 245, 255, 250 | |
Azure | #F0FFFF | 240, 255, 255 | |
AliceBlue | #F0F8FF | 240, 248, 255 | |
GhostWhite | #F8F8FF | 248, 248, 255 | |
WhiteSmoke | #F5F5F5 | 245, 245, 245 | |
Seashell | #FFF5EE | 255, 245, 238 | |
Beige | #F5F5DC | 245, 245, 220 | |
OldLace | #FDF5E6 | 253, 245, 230 | |
FloralWhite | #FFFAF0 | 255, 250, 240 | |
Ivory | #FFFFF0 | 255, 255, 240 | |
AntiqueWhite | #FAEBD7 | 250, 235, 215 | |
Linen | #FAF0E6 | 250, 240, 230 | |
LavenderBlush | #FFF0F5 | 255, 240, 245 | |
MistyRose | #FFE4E1 | 255, 228, 225 |
Black, Gray, and Dark Color Variations
Here is the HTML code for the gray color variations:
Results | HTML Color Codes | Hex Codes | RGB Codes |
---|---|---|---|
Gainsboro | #DCDCDC | 220, 220, 220 | |
LightGray | #D3D3D3 | 211, 211, 211 | |
Silver | #C0C0C0 | 192, 192, 192 | |
DarkGray | #A9A9A9 | 169, 169, 169 | |
Gray | #808080 | 128, 128, 128 | |
DimGray | #696969 | 105, 105, 105 | |
LightSlateGray | #778899 | 119, 136, 153 | |
SlateGray | #708090 | 112, 128, 144 | |
DarkSlateGray | #2F4F4F | 47, 79, 79 | |
Black | #000000 | 0, 0, 0 |
In addition to the above options, you can also combine various other colors to produce the right combination. Because, there are so many possible colors that can be selected using HEX or RGB codes.
Here are examples of colors that do not have HTML color codes but can be produced using HEX and RGB codes:
Results | HEX Codes | RGB Codes |
---|---|---|
#A2A832 | rgb(162, 168, 50) | |
#3259A8 | rgb(50, 89, 168) | |
#7C3F55 | rgb(124, 63, 85) | |
#8A7342 | rgb(138, 115, 66) | |
#B1849F | rgb(177, 132, 159) | |
#52619F | rgb(82, 97, 159) | |
#9C754D | rgb(156, 117, 77) | |
#5F7E68 | rgb(95, 126, 104) | |
#AC6F95 | rgb(172, 111, 149) | |
#5D6D8E | rgb(93, 109, 142) |
Current Digital Color Representations
Currently, there are several digital color models used in visual design, each with its own ideal use cases.
For example, HTML color codes are easier and more practical because they directly write their names, HEX guarantees more precise colors, and RGB can be used for advanced color manipulation.
By learning these color codes, you can also create an attractive visual experience, ensuring that your designs can be displayed smoothly on various devices and platforms.
Here are some of the most popular digital color models today:
-
- HTML Color Codes. Implemented using the color name, not the code. For example: red, antiquewhite, darkorange. The number of possibilities is more limited than other color models.
- Hexadecimal (Hex) Color Codes. Uses a combination of 6 digits and letters to represent a color. For example, #FFFFFF represents white.
- RGB Color Codes. Stands for Red, Green, Blue. Colors are displayed by specifying the intensity of the three primary colors, red, green, and blue. For example, rgb(255, 255, 255) for white. RGB has a variation, RGBA, which includes an Alpha value for opacity. For example, rgba(255, 255, 255, 1) represents opaque white.
- CMYK Color Codes. Stands for Cyan, Magenta, Yellow, Key (Black). This model is mainly used in color printing. In its implementation, colors are mixed based on the percentage of the four colors. For example, a deep blue color can be represented as cmyk(100%, 80%, 0%, 20%).
- HSV Color Codes. Stands for Hue, Saturation, Value. With this model, color properties are controlled intuitively based on hue, saturation, and value. For example, a bright yellow color can be represented using the code hsv(60°, 100%, 100%).
- HSL Color Codes. Stands for Hue, Saturation, Lightness. This format represents colors in a way that is easier for humans to understand. For example, hsl(0, 0%, 100%) is white. HSL also has a variation that determines opacity, namely HSLA. For example, hsla(0, 0%, 100%, 1) will produce an opaque white color.
Example of How to Use HTML Color Codes
Okay, after understanding the colors that exist, you also need to know how to apply them to create a visually appealing and consistent design.
Below, we will share some practical examples of using HTML color codes using Hex. If you prefer to use HTML or RGB color codes, simply replace the Hex code with the appropriate value.
For example, to use HTML or RGB color codes for red, simply replace the code in the format #FF0000 with red or rgb(255, 0, 0), according to the list in the table.
Change Text Color
Below, we will show you how to change text color using Hex color codes to get the results as below:
This text example uses Hex color codes: #FF0000
This text example uses Hex color codes: #00FF00
This text example uses Hex color codes: #0000FF
To apply the color customization above, you can write code like this:
<p style="color: #FF0000; margin-bottom: 10px;">This text example uses Hex color codes: #FF0000</p> <p style="color: #00FF00; margin-bottom: 10px;">This text example uses Hex color codes: #00FF00</p> <p style="color: #0000FF; margin-bottom: 10px;">This text example uses Hex color codes: #0000FF</p>
Coloring Table Borders
The following example shows how to apply color to table borders using Hex code, which will produce an output like the following:
Table Border Color Example 1 |
Table Border Color Example 2 |
Table Border Color Example 3 |
The codes you can use are:
<table style="border: 2px solid #FF0000; margin-bottom: 10px;"> <tr> <td>Table Border Color Example 1</td> </tr> </table> <table style="border: 2px solid #00FF00; margin-bottom: 10px;"> <tr> <td>Table Border Color Example 2</td> </tr> </table> <table style="border: 2px solid #0000FF; margin-bottom: 10px;"> <tr> <td>Table Border Color Example 3</td> </tr> </table>
Adding Background Color to Text
The example below shows how to add background color to text using Hex code. As a result, you will see text like below:
This example text is given a background color using the Hex color code: #F08080 (Light Coral)
This example text is given a background color using the Hex color code: #98FB98 (Pale Green)
This example text is given a background color using the Hex color code: #87CEFA (Light Sky Blue)
To make adjustments like the above, you can use the following code:
<p style="background-color: #F08080; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #F08080 (Light Coral)</p> <p style="background-color: #98FB98; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #98FB98 (Pale Green)</p> <p style="background-color: #87CEFA; color: #000000; margin-bottom: 10px;">This example text is given a background color using the Hex color code: #87CEFA (Light Sky Blue)</p>
Changing HTML Button Color
You can also change the color of buttons created using HTML code, as in the following example.
The codes you can write to get the above results are:
<button style="background-color: #FF0000; color: #ffffff; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 1</button> <button style="background-color: #00FF00; color: #000000; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 2</button> <button style="background-color: #0000FF; color: #ffffff; padding: 10px 20px; border: none; margin-bottom: 10px;">Hex Button Color Example 3</button>
In addition to setting the color, you can also space each button by setting the padding number (for example 10px, 20px, and so on).
Set the Color of a Div Element
This example will show you how to set the background color of a div element that can contain multiple elements, including text, images, or other HTML elements. The result will look like this:
Unlike the text background element, the <div> element is used to set the background color of a container or larger division on a web page.
Following are the codes used to produce the above output:
<div style="background-color: #F08080; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #F08080 (Light Coral)</div> <div style="background-color: #98FB98; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #98FB98 (Pale Green)</div> <div style="background-color: #87CEFA; color: #000000; padding: 20px; margin-bottom: 10px;">Div with Hex background color: #87CEFA (Light Sky Blue)</div>
How to Find Color Codes Easily
To find the HEX or RGB code of a particular color, there are various tools that you can use. Some of these tools are provided by default on the device you are using, and some are available online.
For example, Microsoft Paint, in the Windows system, has a color picker tool that also displays the code in HEX, RGB, and HSV. You can access it from the Colors section, then simply hover over the desired color, the Hex color code will appear on the right.
In addition, there are also various online tools that you can use. It is not difficult to find them, because Google provides a color picker that you can directly access from the search engine results page (SERP).
Just type “HTML color picker” in the Google search field, then you can access this tool, with HEX, RGB, CMYK, HSV, and HSL code options. Select a color by hovering over it, then see the preview on the left. After that, you can copy the code as needed.
Using this tool, designers and developers can easily choose and determine the right colors so they can apply them consistently to projects that require a creative process.
Conclusion
HTML color codes play a very important role if you often handle things related to design and web development. Using these codes, you can adjust the visual elements and appearance of the website precisely to create a design that is according to plan.
By understanding the different types of color codes and their uses, you can create attractive and accessible web pages. You can then use this tutorial as a reference to refine your designs and ensure color consistency across your projects.
AUTHOR BIO
On my daily job, I am a software engineer, programmer & computer technician. My passion is assembling PC hardware, studying Operating System and all things related to computers technology. I also love to make short films for YouTube as a producer. More at about me…