HTML Tags
Advertisements

HTML <font> Tag Not Supported in HTML5

Topic: HTML5 Tags ReferencePrev|Next

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.

Attribute Value Description
color color Obsolete Sets the text color.
face font-family Obsolete Sets the font face of text.
size number Obsolete Sets the size of the font.

Browser Compatibility

The <font> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: CSS Fonts.

Related tag: <basefont>.

Advertisements
Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties