Copyright © tutorialspoint.com

HTML <font> tag



Advertisements

Function:

The HTML <font> tag is used to specify the font of the text.

Difference between HTML and XHTML:

The font element is deprecated in HTML as well as in XHTML. So start using CSS.

Example:

<p>
<font face="cursive,serif" color="#ff9900" size="4">
The HTML font tag is now deprecated. You should use start using CSS to set font size and family.
</font>
</p>

This will produce following result:

The HTML font tag is now deprecated. You should use start using CSS to set font size and family.

Online Practice:

To Become more comfortable - Do Online Practice

Attributes:

AttributeValueDescription
colorrgb(x,x,x)
#hexcode
colorname
Deprecated - Specifies the color of the text.
faceList of font namesDeprecated - Specifies the font families.
sizenumberDeprecated - Specifies the font size from 1 to 7.

Standard Attributes:

AttributeDescription
classDocument wide identifier
dirSpecifies the direction of the text
idDocument wide identifier
titleSpecifies a title to associate with the element.
styleHelps to include inline casecadubf style sheet.
langSets the language code.

Copyright © tutorialspoint.com