The <font> Tag 117
Formatting
Text
The <font> Tag
Web Design in a Nutshell, eMatter Edition
Specifying Size with
You can use thesizeattribute within thetag to adjust type size. This
attribute is supported by versions 1.1 and higher of both Navigator and Internet
Explorer.
Browsers measure 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 20 percent smaller or larger than the default size, 3.
The size value can be specified as an absolute value from one to seven or as a
relative value by means of a plus or minus sign. When relative values are given,
the default value (which is 3, unless otherwise specified with a
increased or decreased by that relative amount. Type will never be displayed
larger than 7 or smaller than 1, even if the relative size results in such a value.
Therefore, block of text is the same as <font
size="+1">block of text,and both will result in a block of text that is
20 percent larger than the default text size.
It is interesting to note that whentags are nested, the effects of their rela-
tive sizes are not cumulative, but rather are always based on the default or
basefont size of the text. Therefore, if the default text size for a document is 3, any
text in that document that is enclosed inwill result in text
with a size of 4, even if that text is nested within a paragraph with<font
size=5>.
advantage
- Gives designers some control over type sizewithout resorting to inappropriate
tags (such as Heading) to adjust size.
disadvantage
- Overrides viewers’ preference for comfortable on-screen reading.By changing
sizes, you risk some viewers seeing type that is illegibly small or ridiculously
big.
Recommendations
- Limit the use ofto small blocks of text, such as copyright infor-
mation, rather than applying a size adjustment to an entire page. - If your content needs to be found by search engines that look for heading
information, do not use thetag as a substitute for HTML head-
ing tags, which are weighted more heavily.
Absolute value 1 2 3 4 5 6 7
Relative value -2 -1 - +1 +2 +3 +4