Search w3schools.com:

SHARE THIS PAGE

HTML <font> Tag. Not Supported in HTML5.


Example

Specify the font size, font face 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

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


Definition and Usage

The <font> tag is not supported in HTML5. Use CSS instead.

The <font> element is deprecated in HTML 4.01.

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


Tips and Notes

Tip: Use CSS to define the font, size, and color of text.


Differences Between HTML 4.01 and HTML5

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


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

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

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

More information about Standard Attributes.


Event Attributes

The <font> tag does not support any event attributes in HTML 4.01.

More information about Event Attributes.




W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The HTML5 Certificate documents your knowledge of advanced HTML5.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The ASP Certificate documents your knowledge of ASP, SQL, and ADO.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]