Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FP: Names and Hex Values for the 16 Common Colors used in HTML Documents


View products that this article applies to.

Summary

This article lists the names and hex values of the 16 common colors used in HTML documents.

↑ Back to the top


More information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: You may receive an error message if you copy the examples directly from this article and paste them into FrontPage. The angle brackets (< and >) may appear as escaped HTML code (< and >). To work around this behavior, paste the script into a blank Notepad document, and then copy it from Notepad before you paste it into FrontPage.

Several HTML tags allow you to specify colors in HTML documents. For example, to set the background color and the default text color, use the BGCOLOR and TEXT attributes of the BODY tag: To specify the color of specific text, use the COLOR attribute of the FONT tag: The hex values are a combination of six hexadecimal digits that are read left to right in pairs, representing the color levels for Red, Green, and Blue (RGB) respectively. These values allow for 24-bit color resolution, or a total of 16,777,216 possible colors. However, not every computer is capable of displaying all of these colors.

The following table lists the names and hex values for the 16 common colors that all computers should be able to display.



To use a specific color, simply specify the color value or name. For example, using the hexadecimal color values the following HTML sample sets the background color to blue, the default text color to white, and the text color for a specific range to black: Because many browsers support the colors listed in the aforementioned table, you can use the name of the color rather than the hexadecimal color value. The following HTML sample shows how to write this code:

↑ Back to the top


References

For additional information about specifying colors in HTML using FrontPage, click the article number below to view the article in the Microsoft Knowledge Base:
304335 Hex Values for the 216 Color Safe Palette Used in HTML Documents
For more information about HTML syntax, please visist the following World Wide Web Consortium (W3C) Web site:

↑ Back to the top


Keywords: KB295546, kbinfo, kbarchive, kbnosurvey

↑ Back to the top

Article Info
Article ID : 295546
Revision : 4
Created on : 10/26/2013
Published on : 10/26/2013
Exists online : False
Views : 457