Skip to: content, navigation

by Ian Lloyd

font (HTML element)

Spec
Depr. Empty Version
Yes No HTML 3.2
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
<font color="colorname/#hexvalue" face="comma-separated list of font-families" size="number">
</font>

Example

An example of font being mis-used:

<p>This is not the way to emphasise text on a page - <font
color="red">remember this!</font></p>

Which would appear as follows:

Example of b element

Type
inline element
Contains
inline elements only
Contained by
block-level elements except pre, inline elements

Description

The font element is one that inspires a certain amount of loathing in these days of standards-based web designing and building. It was originally introduced as a mechanism for applying arbitrary styles inline, but was basically misused in the past as authors tried to squeeze the most out of their web pages. The problem with font is basically that it offers no semantic meaning about its contents. A page heading should be marked up using a heading element (e.g., h1, h2 etc) and a block of quotation should use blockquote, but the problem with font is that it encouraged page authors to use font to achieve those type of effects, hence <font size="7">Today’s news</font> rather than the more appropriate <h1>Today’s news</h1>.

Use this for…

Text content of any kind.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

As one of the earliest-used formatting elements, font has full browser support. As the font element is depreciated and highly presentational in nature, the better option is to use the CSS font property.

In this Section

User-contributed notes

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters