This Physical Style element is the most versatile of all the
character formatting elements and is also the only one of this type to
accept its own special attributes. The element was first introduced by Netscape which
allowed for the SIZE attribute to control font sizing. Internet Explorer
followed suit and added two new attributes, COLOR and FACE
which control the text color and typeface respectively. Until this element
was introduced, the only font display variations produced at the
character level by graphical browsers were usually Bold, Italic,
Underline and fixed-width fonts, or combinations of those
characteristics. Addition of this element to HTML greatly increased an
author's presentation capabilities (although this control is quite meager
now compared to what Cascading
Style Sheets[-->Index DOT Css] now
allows.)
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0; Dropped in XHTML 1.1 in favor of CSS
Required? No
Description:
This attribute indicates a specific font typeface to be used instead
of the default typeface used in the browser. If the system that is
viewing the document does not have the font typeface specified by
this attribute then the browser default is used. To ease portability,
multiple typefaces can be specified in the attribute value separated
by commas. It will check for availability starting from the style name
on the left, working its way right.
Values:CDATA.
[Comma separated list of font names. If the font name contains spaces,
the whole name should be embedded in single quotes (the ' character.)]
Description:
This attribute controls the boldness characteristics of text content
in the same way the
'font-weight'
[-->Index DOT Css] property
does in CSS - a nine level boldness scale (100-900) with '400' being the
standard default. Values can also be expressed as relative changes (+/-)
of the current font boldness.
Description:
This new Netscape attribute is an alternate method of specifying the
size of text content. It allows for a richer range of font sizes than
the static 7 level scale used by the SIZE attribute. Documentation does
not specify what should happen if BOTH SIZE and POINT-SIZE
attributes are present.
Values: Integers representing font point size
Size
[2|3|3.2|4]
[X1|X1.1]
[IE1|M|N1|O2.1]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0; Dropped in XHTML 1.1 in favor of CSS
Required? No
Description:
This controls the size of text contained in the font tag.
Values: CDATA.
[Values are integers which represent absolute values in the size
range from 1 (smallest) to
7 (largest). Values can also be
specified relative to the current BASEFONT value (default
usually being 3) by preceding an integer value with a '+' or
'-' symbol.]
Markup example and Tests
Font SIZE relative: <fontsize="+2">font text</font>
Font SIZE absolute: <fontsize="6">font text</font>
Font POINT-SIZE: <fontpoint-size="20">font text</font>
Font COLOR: <fontcolor="#00FF00">font text</font>
Font FACE:
<fontface="Verdana,'Times New Roman',System">font text</font>
The FONT element should behave as any other character formatting
element would, but because its behavior is an expanded set over other
elements like it, its behavior can not be assumed to be as consistent as
other character elements on ANY browser.
FONT characteristics can be applied and mixed within Heading
levels to provide further visual clarification between headings in
addition to system default heading differences. Doing this will
still preserve the semantic differences between headings.
Color
The COLOR attribute offers a GREAT alternative way to
create visually distinct text/section markers in long runs of text.
There has been an interesting progression of support for applying
FONT COLOR to hyperlink elements. Early behavior of the browsers that support
this attribute (which has since changed) was that it generally had no
effect on the hyperlink color. This may have been to ensure a consistent
visual scheme to identify the links. See the 'Browser Peculiarities
section below for more details. (Note: The use of
Cascading Style
Sheets[-->Index DOT Css]
in supporting browsers can offer an easy solution to this issue as well.)
It is possible to set a passage of text to the background
color. You will be hanging yourself if you do this. =)
Warning: On browsers that do not support this, all visual
distinctiveness gained through applied color formatting will
NOT appear. Use at your own risk.
Face
This is a tricky attribute. Because the font specified must be
on the reader's system in order for the element to work, the use of this
attribute is not terribly wise. The problem is that each type of platform
(Macintosh, PC, UNIX, Etc.) has its own specific set of fonts.
Another reason not to use this is because authors can almost
never guarantee that a given font name is on the browser's system.
[Test]
Beginning in Netscape 4.0 beta 5 a consistent set of generic,
cross-platform font family names are available for use in Netscape browsers
for the FONT FACE element. These are the same generic names allowed by the
'font-family'
[-->Index DOT Css]
CSS property: serif |
sans-serif | cursive |
fantasy | monospace
There was work underway to create a common set of fonts for the web to
solve this problem, (and work in CSS2 to describe downloadable fonts), but
this scheme hasn't been widely implemented or used.
Size
[Test]
Decimal values for SIZE are usually rounded, and values that are
out of bounds should be set to the nearest equivalent value.
It is strange that HTML heading levels have 6 integral levels, while
FONT SIZE has 7. Special attention should be paid to these differences.
Using a FONT SIZE (or other attribute) instead of a corresponding
heading level to distinguish the importance of contained text is not
recommended. Use the heading level elements instead.
Browser Peculiarities
[Test]
A brief history of FONT COLOR and A HREF interaction behavior:
Netscape 2,3:
Coloring Hyperlinks only works if the FONT COLOR is applied INSIDE
the hyperlink, and ONLY if both are INSIDE a table cell.
Internet Explorer 1, 2, 3, Netscape 4.0 Beta 1-3, Opera:
Coloring hyperlinks does not work at all.
Internet Explorer 4.0, Netscape 4.0 Beta 4+:
Coloring hyperlinks works anywhere (not just inside tables) if the
FONT COLOR is applied INSIDE the hyperlink.
[Tests: 1,
2]
The effects of the FONT element are generally not inherited by content
nested inside tables. If an author wishes to ensure that the effects
of the FONT element are applied everywhere, the element must also be applied
for every table cell in a table (in such a case CSS would be a simpler answer.)
These are the FONT attributes which apply to content within tables:
Internet Explorer
2.0: COLOR and FACE applied, SIZE ignored
3.0+: FACE applied, COLOR and SIZE ignored
Netscape:
None of the FONT element attributes has any effect on content nested in tables.
Opera:
All FONT element attributes have an effect on content nested in tables.
Netscape's POINT-SIZE attribute is curious - it appears to be an attempt
to give added control over fonts similar to that allowed through CSS. One
of the main reasons for CSS was to STOP the proliferation of new physical style
elements and attributes created by the browsers.
A reader has reported a possible use for POINT-SIZE: Applying a 'font-size'
property to the BODY element overrides all FONT SIZE attributes. The
POINT-SIZE attribute appears to give control over font size back
to the FONT element.
The few places where Netscape's documentation mentions the behavior for
FONT-WEIGHT attribute, it incorrectly calls it the WEIGHT attribute.
I believe this is just a typo intended to document the actual
FONT-WEIGHT attribute (which only appears to have been documented in
a document on the Mozilla site.)