The <font> Tag

The <font> tag is an inline style tag used to specify the size, color, and font face for the enclosed text using the size , color , and face attributes, respectively. It was created as an extension to HTML to give designers more control over the display of text. The dark side of the <font> tag is that it introduces very specific display information into the HTML markup. As noted several times in this book, in an ideal world, style would be kept separate from content. In HTML 4.01, the <font> tag and all its attributes have been deprecated in favor of the superior formatting capabilities of style sheets. Despite this, it continues to be quite popular (even the best authoring tools rely on it heavily), so it isn’t likely to go away any time soon. That said, let’s look at how the font tag is used.

A single <font> tag may contain all of these attributes as shown:

<FONT FACE="sans-serif" COLOR="white" SIZE="+1">

For an explanation of acceptable values for the color attribute, refer to Chapter 16.

Specifying Size with <font>

You can use the size attribute within the <font> tag to adjust type size. This attribute is supported by Versions 1.1 and higher of both Navigator and Internet Explorer.

Browsers measure HTML type on a relative scale from 1 to 7, where 3 is the default and will be displayed at the size specified by the user’s preferences. These “virtual” sizes are relative, meaning they do not signify actual pixel or point adjustments. Each size is successively about ...

Get Web Design in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.