Summary -

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

The <basefont> tag is not supported in HTML5. Text family, size and color will be specified. The <basefont> tag is supported in Internet Explorer 9, and earlier versions.

<basefont> tag use in head section as well as body section. The <basefont> 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 <basefont> tag.

The text that follows the <basefont> tag will remain unchanged until </basefont> tag.

Syntax -

<basefont>.. text here.. </basefont>

Optional Attributes -

AttributeDescriptionValues
ColorSpecifies the color of the textColor_name RGB(x,x,x) #RRGGBB
FaceSpecifies the text fontFont_family
SizeSpecifies the font size The 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>Basefont tag example.. </title>
	</head>
	<body>
		<basefont face="verdana" color="green" size="1">Font example 
		output display with color green and of size=1</basefont> 
		
		<p> basefont tag is not supported in any browser. 
		Use CSS instead.</p>
</body>
</html>

Output -

Font example output display with color green and of size=1

Note! Use CSS instead as basefont tag is not supported in any browser.