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 »


Definition and Usage

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

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


Browser Support

Element
<font> Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

The <font> tag is not supported in HTML5.


Compatibility Notes

CSS Example: Set the color of text

In our CSS tutorial you can find more information about CSS text color and CSS fonts.


Optional Attributes

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

HTML <font> color Attribute

Example

Specify the color of text:

<font color=”red”>This is some text!</font>

Try it Yourself »


Definition and Usage

The color attribute specifies the color of the text inside a <font> element.


Browser Support

Attribute
color Yes Yes Yes Yes Yes

Compatibility Notes

The color attribute of <font> is not supported in HTML5. Use CSS instead.

CSS syntax: <p style=”color:red”>

CSS Example: Set the color of text

In our CSS tutorial you can find more details about the color property.


Syntax

<font color=”color_name|hex_number|rgb_number“>

Attribute Values

Value Description
color_name Specifies the text color with a color name (like “red”)
hex_number Specifies the text color with a hex code (like “#ff0000”)
rgb_number Specifies the text color with an rgb code (like “rgb(255,0,0)”)

HTML <font> face Attribute

Example

Specify the font of text:

<font face=”verdana”>This is some text!</font>

Try it Yourself »


Definition and Usage

The face attribute specifies the font of the text inside a <font> element.


Browser Support

Attribute
face Yes Yes Yes Yes Yes

Compatibility Notes

The face attribute of <font> is not supported in HTML5. Use CSS instead.

CSS syntax: <p style=”font-family: verdana”>

CSS Example: Set the font of text

In our CSS tutorial you can find more details about the font-family property.


Syntax

<font face=”font_family“>

Attribute Values

Value Description
font_family The font of the text. To specify a prioritized list of several fonts, separate the names with a comma (like this <font face=”verdana,arial,sans-serif”>

HTML <font> size Attribute

Example

Specify the size of text:

<font size=”6″>This is some text!</font>

Try it Yourself »


Definition and Usage

The size attribute specifies the size of the text inside a <font> element.


Browser Support

Attribute
size Yes Yes Yes Yes Yes

Compatibility Notes

The size attribute of <font> is not supported in HTML5. Use CSS instead.

CSS syntax: <p style=”font-size:20px”>

CSS Example: Set the size of text

In our CSS tutorial you can find more details about the font-size property.


Syntax

<font size=”number“>

Attribute Values

Value Description
number A number from 1 to 7 that defines the size of the text. Browser default is 3.

Post Author: Zahid Farid