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

<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

<!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 &lt;font&gt; Tag Example</h2>

<p>
  <font face="Arial" size="4" color="blue">
    This text is Arial, size 4, and blue using the deprecated &lt;font&gt; 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

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
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

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.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend