Description

The <font> tag defines font styles for its content. This tag was typically used to define the font size, color and face for the text in its contents.

The following table summarizes the usages context and the version history of this tag.

Placement:Inline
Content:Inline and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 3.2, 4, 4.01 (transitional)

Warning: Do not use this tag since it is a non-standard tag and has been deprecated in HTML 4.01. It has been removed in HTML5 and shouldn't be used anymore. You should use CSS font property, instead.

Syntax

The basic syntax of the <font> tag is given with:

HTML/XHTML: <font size="number" color="color" face="font-family, ..."> ... </font>

The example below shows the <font> tag in action.

<!--Example of bad usage-->
<p>This is the <font size="3" color="red" face="Verdana,Arial,sans-serif">wrong way</font> to style text.</p>
<!--Alternative-->
<p>This is the <span style="font-size:16px; color:green; font-family:Verdana,Arial,sans-serif;">right way</span> to style text.</p>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <font> tag.

Browser Compatibility

Element
<font>YesYesYesYesYes