English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <font> tag

The HTML <font> element ( <font>) defines the font size, color, and presentation of the content. This feature has been removed from the Web standard, although some browsers still support it, it may stop supporting it in the future. Please do not use this feature as much as possible.

Online Example

Specify the text size, font, and color:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Basic Tutorial(oldtoolbag.com)</title> 
</head>
<body>
<p><font size="3" color="red">This is some text!<!/font></p>
<p><font size="2" color="blue">This is some text!<!/font></p>
<p><font face="verdana" color="green">This is some text!<!/font></p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the <font> tag.

Tag Definition and Usage

HTML5 The <font> tag is not supported. Please use CSS instead.

In HTML 4.01 In HTML, the <font> element is deprecated.

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

Tips and Notes

Tip:Please use CSS to define the text'sFont, size, and color.

HTML 4.01 with HTML5differences

HTML5 The <font> tag is not supported, HTML 4.01 The <center> tag is deprecated.

Optional Attributes

AttributeValueDescription
colorrgb(x,x,x)
#xxxxxx
colorname
HTML5 Not supported. HTML 4.01 Deprecated.    specify the color of the text.
facefont_familyHTML5 Not supported. HTML 4.01 Deprecated.    specify the font of the text.
sizenumberHTML5 Not supported. HTML 4.01 Deprecated.    specify the size of the text.

Standard Attributes

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

AttributeValueDescription
classclassnamespecify the class name of the element
dirrtl
ltr
specify the text direction of the content within the element
ididspecify the unique id of the element
langlanguage_codespecify the language code of the content within the element
stylestyle_definitionspecify the inline style of the element
titletextspecify additional information about the element

For a complete description, please visitStandard Attributes.

Event Attributes

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

For a complete description, please visitEvent Attributes.