In HTML and CSS, colors are specified in either of two ways: by using a color name or by using numbers to denote a red-green-blue (RGB) color value.
HTML has defined 16 basic color keywords that all browsers support. Any element with a color property (e.g., 'color', 'background', etc.) can take one of the following names. The basic color names are:
aqua
| |
black
| |
blue
| |
fuchsia
| |
gray
| |
green
| |
lime
| |
maroon
| |
navy
| |
olive
| |
purple
| |
red
| |
silver
| |
teal
| |
white
| |
yellow
| |
NOTE: As HTML formatting have been deprecated in favor of style sheets, the discussions here refer to specifying colors in CSS, except when noted.
For example, the following CSS rule defines the default background and foreground colors of a page.
BODY {background:navy; color:lime}