Prev

Colors

The <font> Tag

Note: Like the image attributes, using the <font> tag is out of favor with web authors, with CSS being preferred.
The <font> tag is a container tag that allows you to change the way your text itself looks. The tag itself does not do much -- all the work is done by the attributes.

The color attribute

Try It: Use the color attribute of the <font> tag to change the color of your text.
One such attribute that is useful and fun is the color attribute. As you might have guessed, this allows you to change the color of your text. The value of the color attribute is name or code for the color you would like the text to be. Although there are only 16 "official" colors, such as gray, green, olive, and aqua, many browsers can recognize a great many color names, even deeppink, slateblue, and tomato. Most browsers will use black if they do not recognize the color you ask for.
Font color example
The following code:
You can make your text <font color="pink">pink</font>, <font color="teal">teal</font>, or <font color="orange">pink</font>!
will be displayed as:
You can make your text pink, teal, or orange!

Hexadecimal Codes

Tip: You can specify a color using a hexidecimal code.
Not all colors have a name, or at least, not all colors have a name that everyone can agree on, so there is another way to specify a color. All colors for the web have a code, called a hexadecimal code, that defines how much red, green and blue is in that color. You can choose a hexidecimal code for a color from one of the many charts on the web and use it just like a name, except you put a # in front of the code.
Hexidecimal color example
The following code:
You can use <font color="#33CC66">hexidecimal codes</font> for even more colors!
will be displayed as:
You can use hexidecimal codes for even more colors!

Prev