XHTML Colour

Colors can be represented either as a six-digit hexadecimal value following the character “#”, or by the “HTML Color Name”.

The XHTML 1.01 standard defines a limited range of 16 Color Names, whereas the six-digit hexadecimal value is unrestricted in range.  The XHTML 1.01 Color Names are illustrated on this page.

The former HTML 4.01 standard defines a wider range of 141 Color Names (see separate page).  A further page illustrates the contrast effect of coloured text against a coloured background, suggesting combinations might be more suitable than others.

In the list below, Color Names are listed with their hexadecimal equivalents.  Colors are exhibited in approximate order of overall colour intensity, from lightest to darkest.

Currently, many browsers applying the XHTML 1.01 standard seem still to support the wider range of HTML4.01 Color Names.  This level of support may change over time, and support for the HTML 4.01 list may not be available on portable and specialist display devices.

  1. To set the background-color property, use the construction:
            style="background-color:[color_name];"
  2. To set the foreground text color property, use the construction:
            style="color:[color_name];"
  3. To set the foreground border-color property, use the construction:
            style="border-color:[color_name];"
 

XHTML 1.01 Color Names

    
"White" "#ffffff"45*
"Silver" "#c0c0c0"36*
"Yellow" "#ffff00"30*
"Fuchsia" "#ff00ff"30*
"Aqua" "#00ffff"30*
"Gray" "#808080"24*
"Olive" "#808000"16*
"Purple" "#800080"16*
"Teal" "#008080"16*
"Red" "#ff0000"15*
"Lime" "#00ff00"15*
"Blue" "#0000ff"15*
"Maroon" "#800000"8*
"Green" "#008000"8*
"Navy" "#000080"8*
"Black" "#000000"0*
 
 
32-9a13  Top of
this page
Home
page
  

John Goodman