www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Color Table

Colors can be specified in HTML pages in two ways—by using numbers to denote an RGB color value, or by using a color name.

Note   Before printing this or any of the related pages on a color printer, select "Print background colors and images" from the Advanced tab of the Internet Options dialog box in Microsoft Internet Explorer.

RGB Notation

An RGB color value normally consists of a '#' immediately followed by a triad of two-digit hexadecimal numbers specifying the intensity of the corresponding color: (R)ed, (G)reen, and (B)lue. For example, the color value #FF0000 is rendered red because the red number is set to its highest value, FF (or 255, in decimal).

Each of the following style rules refer to the same color: namely, red. The three digit short-hand form is converted into the six-digit form by replicating digits (#F00 becomes #FF0000). The "functional" RGB notation uses a comma-separated list of decimal or percentage values.

EM { color: #f00; }              /* #rgb */
EM { color: #ff0000; }           /* #rrggbb */
EM { color: rgb(255, 0, 0); }    /* integer range 0 - 255 */
EM { color: rgb(100%, 0%, 0%); } /* float range 0.0% - 100.0% */ 
EM { color: red; }               /* color keyword */ 

Standard HTML Colors

Only 16 color "keywords" (names) are defined by the HTML 4.01 standard. These colors can always be rendered properly, regardless of the color resolution of the user's display card.

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 Cascading Style Sheets (CSS), Level 2 Revision 1 (CSS2.1) specification includes "orange" (#FFA500) for a total of 17 color keywords.

Additional Color Names

In addition to the colors listed above, Internet Explorer supports a wide variety of named colors. Click the links below to browse these colors by name, or as sorted by hue, lightness, and color saturation. Not all browsers support these additional named colors; therefore, when specifying color values for Web pages targeted to work across different browsers, use the RGB color values.

System Colors

You can also leverage the Microsoft Windows system colors that users have chosen to display various user interface (UI) components.

Standards-Compliant Mode

When you use the !DOCTYPE declaration to specify standards-compliant mode, Internet Explorer 6 and later versions ignore style sheet declarations that do not comply with CSS, Level 1 (CSS1). According to CSS 1, colors specified with hexadecimal RGB values must have a leading '#' character. Values like "FFFFFF" are ignored, not treated the same as "#FFFFFF" (also known as white) as in previous versions of Internet Explorer. This affects all CSS attributes and properties that accept an RGB color value.

Related Topics

Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG