Font HTML

HTML <font> Tag

The HTML <font> tag is not supported in HTML5. It was used to specify the font style which includes the font size, colour, and face of the specified content. CSS properties are now used, instead of the HTML <font> tag.

Syntax:

<font size=" " color=" " face=" ">Content</font>

Example:

<!DOCTYPE html>
<html>
<body>
<p><font size="5" color="Red">HELLO WORLD!!</font></p>
<p><font size="4" color="Chocolate">HELLO WORLD!!</font></p>
<p><font face="arial" color="DarkGreen">HELLO WORLD!!</font></p>
</body>
</html>

Output:

Explanation:

In the above example, we are using the HTML <font> tag to specify the font style. Using the HTML <font> tag attributes we specified different colors, size and face for the different contents.

Example: Using CSS.

<!DOCTYPE html>
<html>
<body>
<p style="font-size:25px; color:Red;">HELLO WORLD!!</p>
<p style="font-size:20px; color:Brown;">HELLO WORLD!!</p>
<p style="font-size:15px; color:Green;">HELLO WORLD!!</p>
<p style="font-family:arial; font-size:25px; color:Red;">HELLO WORLD!!</p>
<p style="font-family:cursive; font-size:20px; color:Brown;">HELLO WORLD!!</p>
<p style="font-family:cursive; font-size:15px; color:Green;">HELLO WORLD!!</p>
</body>
</html>

Output:

Explanation:

In the above example, we are using CSS to specify the font style. Using the CSS style properties we specified different colors, font-size and font-family for the different contents.

Tag specific Attributes:

Attribute Value Uses
color rgb(X,X,X)

#xxxxx

color_name

To define the color of the specified content. Not Supported in HTML5.
face font_family To define the font of the specified content. Not Supported in HTML5.
size number To define the font size of the specified content. Not Supported in HTML5.

Global Attributes:

The HTML GLobal attributes are supported by the HTML <font> tag.

Event Attributes:

The HTML Event attributes are supported by the HTML <font> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera and Safari.

Please Share