HTML Tutorials > Day Two

HTML Colors

Color is considered an attribute in HTML. It can be added on to most tags as either color (for font) or bgcolor. The bgcolor attribute can be used on tags such as <body> or <table> and has the same properties as color. One tag that uses the color attribute is the <font> tag as talked about in the previous tutorial. Colors in HTML can either be called by their names or by their hexadecimal codes. Hexadecimal codes are 6-character codes which generate colors based upon them. If you ever wanted to learn more about the hexadecimals, there's a good background on them here. The easiest way to find these codes is to open Photoshop and click on the Foreground Color. Then select the color you want in the color table. It's value will displayed as a hexadecimal value in that properties box as illustrated below. It is recommended to use the hexadecimal codes as you can pretty much use any color that exists with them. Calling colors by their names will only get you one shade of certain colors like blue, black or white.

Image

Image
Click on the thumbnail to enlarge...

The highlighted field on the second image will tell you your 6-character hexadecimal code. This is one of the easier ways of finding hexadecimal codes when I do web pages. There's ways to find them within Dreamweaver as well, but the Photoshop way is very convenient when making a design. Also note that the field is labeled with a # sign. This is required in HTML before placing the hexadecimal code. Here's an example of different color codes with the font tag:

Code Example:

<p><font color="orange">Orange text</font></p>

<p><font color="red">Red text</font></p>

<p><font color="#FF0072">Magenta text</font></p>

Code Display:

Orange text

Red text

Magenta text

On to Page 2


This web page created, developed, and maintained by Kyle Spahn and Mr. Krebs.