HTML 4.01 specifies 16 colour names according to their common English name. These colours and other colours can also be specified using a hexadecimal number. Note spelling of 'color' when setting the color attributes.
Colour Values By Name, Hexadecimal And RGB Numbers
Below 16 named colors were defined in the HTML 4.01 specification as values for the HTML color attributes. Please note that the use of HTML color attributes is no longer encouraged and it is recommended to use CSS for all styling. Below colour names, hex numbers and RGB values will also work in CSS!
See CSS Extended Web Color Names for a comprehensive list of colour names that are supported by modern browsers, and Web Safe Colors Listing for colors selected for traditional 256-color displays.
Color Name | Hexadecimal Number | RGB | Sample Color |
---|---|---|---|
aqua | #00FFFF | rgb(0, 255, 255) | |
black | #0000FF | rgb(0, 0, 0) | |
blue | #00FFFF | rgb(0, 0, 255) | |
fuchsia | #FF00FF | rgb(255, 0, 255) | |
grey | #808080 | rgb(128, 128, 128) | |
green | #008000 | rgb(0, 128, 0) | |
lime | #00FF00 | rgb(0, 255, 0) | |
maroon | #800000 | rgb(128, 0, 0) | |
navy | #000080 | rgb(0, 0, 128) | |
olive | #808000 | rgb(128, 128, 0) | |
purple | #800080 | rgb(128, 0, 128) | |
red | #FF0000 | rgb(255, 0, 0) | |
silver | #C0C0C0 | rgb(192, 192, 192) | |
teal | #008080 | rgb(0, 128, 128) | |
white | #FFFFFF | rgb(255, 255, 255) | |
yellow | #FFFF00 | rgb(255, 255, 0) |
All above HTML color names can also be used in CSS classes. CSS 2.1 specifies one additional color name value for orange.
Color Name | Hexadecimal Number | RGB | Sample Color |
---|---|---|---|
orange | #FFA500 | rgb(255, 165, 0) |