HTML <font> Tag
The <font> tag defines the size, typeface, and color of their text.characteristics. Not supported in HTML5. Learn how to use <font> tag. See examples.
The <font> tag defines font characteristics. Size, color, and typeface are controlled by the size, color, and face attributes.
The <font> tag is a deprecated HTML tag. Instead of it, use CSS styles (see an example below).
Syntax
The <font> tag comes in pairs. The content is written between the opening (<font>) and closing (</font>) tags.
Example of using HTML <font> tag:
Example of HTML <font> Tag
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<p>
<font size="2" color="#1c87c9">Blue text</font>
</p>
<p>
<font size="3" color="red">Red text, font size increased.</font>
</p>
<p>
<font face="arial" color="#8ebf42">Green text, typeface changed.</font>
</p>
</body>
</html>Result

CSS Styles
To change the text color, use the CSS color property instead of the color attribute. CSS font-family replaces the face attribute, and instead of the size attribute, the CSS font-size property is used.
Example of changing the style of the text with CSS:
An example where using CSS color, font-family, font-size properties instead of color, face and size attributes
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<p style="font-size:16px; color:#1c87c9;">Blue text.</p>
<p style="font-size:18px; color:red;">Red text, font size increased.</p>
<p style="font-size:18px; color:#8ebf42; font-family:arial;">Green text, typeface changed.</p>
</body>
</html>Attributes
| Attribute | Value | Description |
|---|---|---|
| color | rgb (x, x, x) #xxxxxx colorname | Sets the color of the text. |
| face | font_family | Sets the typeface. |
| size | number | Sets the size of the text. |
Practice
What are the features of the HTML Font tag?