font (HTML element)

Spec
Depr. Empty Version
Yes No HTML 3.2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

<font color="colorname/#hexvalue" face="comma-separated list of font-families" size="number">
</font>

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>.

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

Use this for…

Text content of any kind.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

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

Related Products