HTML HEX Colors: A hexadecimal color is specified with #RRGGBB, where the RR (red), GG (green), and BB (blue) hexadecimal integers indicate the parts of the color.
Defining HTML Colors
There is no special HTML color tag, as the design isn’t the main function of HTML. Coloring your site is a piece of CSS inline styling. This means you need to use the style attribute in the opening tag you wish to add HTML color to.
You may use the color property to change the color of your text, or background color to change the color of the background. Both of these properties take color names, RGB, RGBA, HEX, HSL, or HSLA values.
HEX Color Values
In HTML, a color can be indicated using a hexadecimal value in the form:
Where rr (red), gg (green) and bb (blue) are hexadecimal values among 00 and ff (same as decimal 0-255).
For instance, #ff0000 is displayed as red, since red is set to its highest value (ff), and the other two (green and blue) are set to 00.
Another example, #00ff00 is displayed as green, since green is set to its highest value (ff), and the other two (red and blue) are set to 00.
To display black, set all color parameters to 00, similar to this: #000000.
To display white, set all color parameters to ff, similar to this: #ffffff.
Experiment by mixing the HEX values below:
Shades of Gray
Shades of gray are often defined using equivalent values for each of the three parameters:
Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your photos and creative projects with us.