HTML Tags – Basefont Tag


What is HTML <basefont> tag ?

HTML <basefont> tag is used to set default font face, size, and color for text inside the webpage.

HTML <basefont> tag is used in both head and body section.

HTML <basefont> tag was used in HTML4 specification.


HTML <basefont> tag is removed in HTML5 specification.

Why HTML <basefont> tag is used ?

HTML <basefont> tag was used in HTML4 for setting default font face, size, and color for all elements.

In HTML5, We can use use CSS properties such as font, font-family, font-size, and color to change the font configuration for text elements.

HTML coding for a website !!!

Click to Learn More about – HTML Tutorial for beginners

Syntax :

<basefont size="14" color="green"/>

Example :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
  <title>HTML basefont tag</title>
  <basefont size="14" color="green"/>
</head>
<body>
  <p>HTML basefont tag</p>
</body>
</html>

Output :

<basefont> Tag Attributes

HTML <basefont> tag support following specific attributes.

SnoAttributesValueDescription
1color#XXXXXXDefine a base URL link.
2targetfontnameDefine a default font face.
3sizesizeDefine a default font size.

Browser Compatibility

SnoBrowserSupport
1ChromeNo
2FirefoxNo
3EdgeNo
4OperaNo
5SafariNo
6Internet ExplorerNo