Summary -

In this topic, we described about the <font> tag along with detailed example.

The <font> tag is not supported in HTML5. Text family, size and color will be specified. The <font> tag is supported in Internet Explorer 9, and earlier versions. <font> tag use in head section as well as body section.

The <font> tag is having three attributes called size, color, and face to customize fonts. To change any of the font attributes at any time using the <font> tag. The text that follows the <font> tag will remain unchanged until </font> tag.

Syntax -

<font>.. text here.. </font>

Optional Attributes -

AttributeDescriptionValues
ColorSpecifies the color of the textColor_name RGB(x,x,x) #RRGGBB
FaceSpecifies the text fontFont_family
SizeSpecifies the font sizeThe range of accepted values is from 1(smallest) to 7(largest). The default size of a font is 3.number

Example -

<!DOCTYPE html>
<html>
	<head>
		<title>Font tag example.. </title>
	</head>
	<body>
		<font face="verdana" color="green" size="1">Font example output
		display for color green and of size=1</font> <br>
		<font face="verdana" color="red" size="2">Font example output
		display for color red and of size=2</font> <br>
		<font face="verdana" color="yellow" size="3">Font example
		 output display for color yellow and of size=3</font> <br>
		<font face="verdana" color="blue" size="4">Font example output
		display for color blue and of size=4</font> <br>
	</body>
</html>

Output -

Font example output display for color green and of size=1 Font example output display for color red and of size=2 Font example output display for color yellow and of size=3 Font example output display for color blue and of size=4