Basic HTML Tutorial: The <FONT>
Tag
Home > Build
> Programming > HTML
> Basic
HTML Tutorial
1.13 The <FONT> tag
What if you want to display your text in a font
other than the default font (which is usually Times or Courier)?
That is where the <FONT> tag comes in. With this tag,
you can change your font, adjust the size, and change the
color of your text.
One thing to remember when creating HTML, is
you are creating it for an audience on many different machines.
There are no standard font packages that are pre-loaded on
every machine. For example, most Macintosh's use the Helvetica
font, while most PC's use the Arial font. Both fonts are similar,
and both can be loaded on the other platform, but rarely are.
That is why, with the font tag, you are able to give a list
of fonts you would like your text displayed in. If you chose
Verdana, Helvetica, and then Arial, then the browser would
first check the computer to see if Verdana is installed. If
it is, the page will display in Verdana. If not, the browser
would go to the next choice, Helvetica, and then to Arial.
It is a good idea to understand fonts, and name several just
in case.
The following are attributes of the <FONT>
tag:
FACE - This is where you choose the typeface(s)
for your page.
COLOR - This is where you specify the color to display the
text. As mentioned before, you can give the number in hexadecimal
format, or use one of the few presets.
SIZE - You can change the size of the font with this attribute.
The range is 1-7, 7 being the largest font size. If a size
is not specified, the default size of 3 will be used. You
can either assign the font size a specific number, add a number
(SIZE="+1", or subtract a number (SIZE="-1").
Examples of FONT attributes:
<HTML>
<HEAD>
<TITLE>Roses are Red</TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">
Roses are Red
</H1>
<P ALIGN="CENTER">
<FONT FACE="Helvetica", "Arial", "Verdana",
"Garamond" SIZE="5" COLOR="blue">
Roses are Red<BR>
Violets are Blue<BR>
You Love me<BR>
and I Love You too!<BR>
</FONT>
</P>
</BODY>
</HTML>
See
it in the Browser