HTML <font>Tag -Not supported in HTML5


Examples

Specifies the size, font, and color of text:

<font size="3" color="red">This is some text!</font> <font size="2" color="blue">This is some text!</font> <font face="verdana" color="green">This is some text!</font>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <font> tag.


Tag Definition and Usage Instructions

HTML5 does not support the <font> tag. Use CSS instead.

In HTML 4.01, the <font> elementis deprecated。

The <font> tag specifies the font, font size, and font color of text.


Tips and Notes

Tip:Use CSS to define the text'sfont, size, and color。


Differences Between HTML 4.01 and HTML5

HTML5 does not support the <font> tag. HTML 4.01 has deprecated the <center> tag.


Optional Attributes

Attribute Value Description
color rgb(x,x,x)
#xxxxxx
colorname
Not supported in HTML5. Deprecated in HTML 4.01.Specifies the color of text.
face font_family Not supported in HTML5. Deprecated in HTML 4.01.Specifies the font of text.
size number Not supported in HTML5. Deprecated in HTML 4.01.Specifies the size of text.


Standard Attributes

In HTML 4.01, the <font> tag supports the following standard attributes:

Attribute Value Description
class classname Specifies the class name of an element
dir rtl
ltr
Specifies the text direction of the content in an element
id id Specifies the unique id of an element
lang language_code Specifies the language code of the content in an element
style style_definition Specifies the inline style of an element
title text Specifies additional information about an element

For a complete description, visitStandard Attributes。


Event Attributes

In HTML 4.01, the <font> tag does not support any event attributes.

For a complete description, visitEvent Attributes。

Other Extensions