Working together for standards The Web Standards Project


Legal Color Names in HTML 4 and XHTML 1.0, 1.1

There are sixteen (16) legal color names for use in HTML 4.x and XHTML. Any other color name is a browser-specific name and cannot be used in conforming HTML 4.x and XHTML documents.

You may use any hexadecimal color value in transitional HTML 4.x or XHTML documents. In Strict documents, you should use CSS, which allows for color names, hexadecimal values, and also RGB values.

Interestingly, the sixteen permitted hexadecimal values are not all websafe colors.

Legal Color Names and Hexadecimal Values
Color Name Hexadecimal Value Sample
Black #000000
Silver #C0C0C0
Gray #808080
White #FFFFFF
Maroon #800000
Red #FF0000
Purple #800080
Fuchsia #FF00FF
Green #008000
Lime #00FF00
Olive #808000
Yellow #FFFF00
Navy #000080
Blue #0000FF
Teal #008080
Aqua #00FFFF

The Web Standards Project is a grassroots coalition fighting for standards which ensure simple, affordable access to web technologies for all.


All of the entries posted in WaSP Buzz express the opinions of their individual authors. They do not necessarily reflect the plans or positions of the Web Standards Project as a group.

This site is valid XHTML 1.0 Strict, CSS | Get Buzz via RSS or Atom | Colophon | Legal