HTML Tags

HTML <font> Tag

The <font> tag was historically used to change the font face, size, and color of text in HTML.
It is deprecated in HTML5, and modern web design uses CSS (font-family, font-size, color) instead.

Syntax

html

<font face="fontName" size="value" color="colorValue">Text</font>

Attributes

AttributeDescription
faceSpecifies the font family of the text.
sizeSpecifies the font size (1–7 or relative values).
colorSpecifies the text color.

Example

html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Font Tag Example</title>
</head>
<body>

<h2>Deprecated <font> Tag Example</h2>

<p>
  <font face="Arial" size="4" color="blue">
    This text is Arial, size 4, and blue using the deprecated <font> tag.
  </font>
</p>

<p>Modern alternative: use CSS <code>font-family</code>, <code>font-size</code>, and <code>color</code>.</p>

</body>
</html>

Output

Browser Output

html

The text inside the <font> tag is displayed using the specified font face, size, and color.
Please use our TryIt Editor to see the effect.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

All major browsers support <font> tag.

Notes

  • The <font> tag is obsolete and should not be used in modern HTML.
  • CSS properties provide a more flexible and standardized approach for text styling.
  • Deprecated tags like <font> may still work in modern browsers for backward compatibility, but using them is not recommended.

Conclusion

The <font> tag was once used to style text directly in HTML, but it is deprecated.
For maintainable and modern web design, always use CSS for text styling.