Colors
The <font>
Tag
Note: Like the image attributes, using
the
The <font>
tag is out of favor with web authors, with
CSS being preferred.
<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
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>
tag to change the color of your text.
Font color example
The following code:
will be displayed as:
The following code:
You can make your text
<font
color="pink">pink</font>,
<font
color="teal">teal</font>,
or
<font
color="orange">pink</font>!
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:
will be displayed as:
The following code:
You can use
<font
color="#33CC66">hexidecimal codes</font>
for even more colors!
You can use hexidecimal codes for even more colors!