HTML and CSS Reference
In-Depth Information
This appendix provides basic information about the use of color on the Web. The
reference not only covers the defined colors formats, names, and values from the
(X)HTML specifications and CSS but presents less obviously standardized but
commonly used color names. A brief discussion of the browser-safe color palette is also
(X)HTML Colors
Transitional versions of HTML and XHTML support color settings for text as well as the
background color of the document, frame borders, tables, or even individual table cells.
There are 16 widely known color names defined in HTML. These names and their
associated hex RGB values are shown in Table C-1.
N OTE Color names and values are case insensitive, so red and RED are equivalent, as are #FF0000
and #ff0000.
Nonstandard Color Names and Numerical Equivalents
Table C-2 lists a set of nonstandard color names commonly supported by the major browsers.
These color names were initially introduced by Netscape, and are apparently the colors
defined by the X11 windowing system for UNIX systems over two decades ago. Regardless
of their origin, these colors are documented in both the SVG specification and the emerging
CSS3 specification; they are still widely used and may someday be considered as standard as
There may be some situations such as in older Opera browsers where a browser does
not support these values. Current testing shows that shipping browsers at the time of this
edition's writing do support these values, and you can test for yourself at http://htmlref
.com/AppC/colorchart.html. If there is some concern about compatibility, Web page authors
should use hex values instead of these names.
Some color references claim that further color variations can be introduced by adding
the numbers 1 through 4 to color names. If this were correct, cadetblue1, cadetblue2,
cadetblue3, and cadetblue4 would display as different shades of the same color,
Search WWH ::

Custom Search