Home | HTML Tutorials | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

The Web Design Group



FONT - Font Change

Syntax <FONT>...</FONT>
Attribute Specifications
Contents Inline elements
Contained in Inline elements, block-level elements except PRE

The FONT element, deprecated in HTML 4.0 in favor of style sheets, allows authors to suggest rudimentary font changes. Use of the FONT element brings numerous usability and accessibility problems, as discussed in the article What's Wrong With FONT?

The least harmful use of the FONT element is in suggesting relative changes in font size with <FONT SIZE="+1"> or <FONT SIZE="-1">. These tags increment or decrement the font size relative to the size specified in the BASEFONT element, or relative to a base size of 3 if no BASEFONT element is used. Sizes are based on a seven-point scale (1..7) that is browser dependent.

While authors can specify SIZE values such as -2 and +3, as well as absolute values such as 1, these kinds of changes are strongly discouraged due to the sensitivity some users have to different font sizes. While a value like -2 may look right to you with your eyesight and user settings, it could easily be unreadable to a user with different eyesight and user settings.

The COLOR attribute suggests a text color. While most browsers allow users to override author color changes, the widely used Netscape Navigator 2.x, 3.x, and 4.x do not override colors specified with FONT. This makes the COLOR attribute very dangerous from an accessibility point of view.

Authors often use the COLOR attribute as a form of emphasis or to indicate a heading. In these cases, use of structural HTML (e.g., STRONG, H1) along with a style sheet provides a more flexible, accessible document.

The FACE attribute gives a comma-separated list of font faces in which to display text. The fonts are listed in order of preference, so that if the browser does not have the first font listed, it will try the second, then the third, and so on.

The FONT element is an inline element, meaning that it cannot contain block-level elements such as P and TABLE. Again, style sheets provide much more flexibility in suggesting font styles.

More Information

Home | HTML Tutorials | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.