FONT Element



Netscape introduced the FONT element to permit control of the size of the displayed font, when possible. Font sizes are defined in a range from 1 to 7 (the default base value, or basefont, is 3). You can then specify a change in font size using elements such as
This is <FONT SIZE=+1>resized</FONT> text.   <BR>
This is <FONT SIZE=-2>resized</FONT> text.   <BR>
This is <FONT SIZE=4>resized</FONT> text.   <BR>

which is rendered as: This is resized text.
This is resized text.
This is resized text.


You can specify the font size relative to the current size (using + or -) or as an absolute size from 1 to 7.

7.2.1 Microsoft/Netscape Attribute Enhancement

Microsoft introduced a new attribute FACE, for specifying the typeface. For example "FACE="arial" would specify an arial font. This is now supported by most browser vendors. The face names are usually taken from the Windows font manager, so you need to know the font names and have the fonts installed for this to work. Clearly this will only work on machines that have the fonts installed locally.

Multiple fonts can be specified, separated by a comma -- the browser looks through the font list, and chooses the first one it finds on the local system. For example, FACE="arial,helvetica,time" will first try arial, then helvetica if arial is not present, and finally try times-roman. Here are some examples:


<FONT FACE="arial,helvetica">Refaced</FONT> text.<BR>
<FONT FACE="times,helvetica">Refaced</FONT> text.<BR>
<FONT FACE="courier">Refaced</FONT> text.   

which is rendered as:

Refaced text.
Refaced text.
Refaced text.

Font color can also be controlled, using a COLOR attribute. For example, COLOR="red" or COLOR="#ff0000" requests red text font. There are several supported color names, but to safe it is best to use RGB color codes, as in COLOR="#RRGGBB".

Example:

<BODY>
<FONT COLOR="#FF0000">This text is red.</FONT>
</BODY>

or

<BODY>
<FONT COLOR="red">This text is also red.</FONT>
</BODY>