HTML Font Tag

font tag in html

HTML Font Tag plays an important role to customize your text in the web page. It helps to make the webpage more attractive and enhances the readability of the web page.

But, remember font tag has been deprecated in HTML5. While it is working in HTML4 or HTML5.

Attributes of HTML Font Tag :-

<font> tag has three attributes, namely : face , color and size

  • face : This attribute specifies the font family of the text given within the font tag.

For Example :

<!DOCTYPE html>
<html>
<body>
<font face="serif">Techno Brainz</font>
<br>
<font face="Arial">Techno Brainz</font>
</body>
</html>

Output :

HTML Font Tag

Fact : We can give an extra font family in the face attribute which works when the first font family is not installed in the user’s system. We generally give “Times New Roman” as the alternate font family as it is by default present in the user’s system.

For Example :

<!DOCTYPE html>
<html>
<body>
<font face="serif, Times New Roman">Techno Brainz</font>
<br>
<font face="Arial, Times New Roman">Techno Brainz</font>
</body>
</html>
  • color : This attribute specifies the color of the text given within the font tag.

For Example :

<!DOCTYPE html>
<html>
<body>
<font face="Arial" color="Red">Techno Brainz</font>
</body>
</html>

Output :

HTML Font Tag
  • size : This attribute specifies the size of the text given within the font tag.

For Example :

<!DOCTYPE html>
<html>
<body>
<font face="Arial" color="Red" size="20">Techno Brainz</font>
</body>
</html>

Output :

Note :-

Watch how to use font tag on YouTube – Click here
Watch Rowspan and Colspan on YouTube – Click here
HTML Favicons – Click here