HTML font Tag

HTML <font> Tag: The HTML<font> tag describes the font face,font size and text color. This HTML font tag is not supported in HTML 5. And also the fonts tag play an important role in the web page to create an attractive and readable web page.

 HTML <font> Tag

The basefont tag is used to set all the text to the same size, color and face. And it has basically three attributes which are given below:

  • Size
  • Face/Type
  • Color

Syntax: <font> Text </font>



font Size: This attribute is used to adjust the size of the text in the HTML document using size attribute. The range of size of the font in HTML is from 1 to 7 and the default size is 3.

Browser compatibility

The HTML<final> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer.

Example:

<!DOCTYPE html>
<html>
<body>
<p><font size="3" color="red">Visit https://tutorials.freshersnow.com/</font></p>
<p><font size="2" color="blue">Welcome to https://tutorials.freshersnow.com/</font></p>
</body>
</html>

Output:

HTML font tag

Attributes that are supported by the <font> tag

Attribute Value Description
color rgb(x,x,x)
#xxxxxx
colorname
Specifies the color of the text
face font_family Specifies the font of the text
size number Specifies the size of text