HTML for People Who Want to Learn  --  HTML for Starters

The Font Element

The <FONT> tag allows you to change the way text appears on a page. You can change the text color, size, and face with the font tag.

 

Implementing The Font Tag

The font tag is used just like any other tag.

<FONT>The text you want to modify.</FONT>

 

Font Color

You can change the color of certain words by using the COLOR attribute. Hexadecimal color codes are used to specify the color you want.

This text is blue.
<FONT COLOR="#0000FF">This text is blue.</FONT>

This text is orange.
<FONT COLOR="#FF9900">This text is orange.</FONT>

 


Font Size

You can change the size of words to cause them to stand apart from other text. There are seven font sizes, 1 being the smallest, and 7 being the largest. The default font size is 3. There are two ways of specifying font size: absolute and relative.


Absolute

Size two text.
<FONT SIZE=2>Size two text.</FONT>

Size five text.
<FONT SIZE=5>Size five text.</FONT>


Relative

Size two text.
<FONT SIZE="-1">Size two text.</FONT>

Size five text.
<FONT SIZE="+2">Size five text.</FONT>

 


Font Face

Trying to read text in the default font isn't always very easy. Luckily, you may specify a different font for the text. But, the visitor must have that font on his/her computer.


<FONT FACE="Arial, Helvetica">This text should be in either "Arial" or "Helvetica".</FONT>

If you have the font called "Arial" on your system, then the above text should be in Arial. If you don't have Arial, the browser then looks to see if you have the font called "Helvetica", which is pretty similar to Arial.

Notice that the first letter in the name of the font is capitalized. Capitalization is very important on systems other than the PC. On a UNIX machine, "Helvetica" will result in Helvetica, but "helvetica" will result in the default font.

Two more commonly-used fonts are Comic Sans MS and Verdana. If you don't see a different font for those names (look closely at Verdana), then you must not have those fonts on your system (which most likely means you aren't on a PC, because those are Microsoft fonts).

 

<FONT FACE="Arial, Helvetica" COLOR="#FF0000" SIZE="+1">That's it for the font tag!</FONT>

 


Back to Chapter 3
HTML for Starters
E-mail
Next: Reference Chart

Last Modified: Saturday, 18-Jul-98 21:50:04 PDT
Page URL: http://geocities.datacellar.net/SiliconValley/Vista/2823/text/htmlchp4.html

1