Description

The HTML element <basefont> is used to define the default base font of an HTML document, which applies to the whole document.

A default base font will determine the properties like font size, font color, and font family.

The below table summarizes its usage.

Usage Details
Placement It is a child of the <head> element.
Contents None. It is an empty element.
Tags Opening tag: required; Closing tag: forbidden
Versions HTML 2, 3.2, 4, 4.01
This element is deprecated in HTML 4.01 and obsolete since HTML5, so avoid using this element in your markup.
Instead, use the CSS font properties.

Syntax

Here is the basic syntax of the <basefont> element.

<basefont>

Examples

Run this on IDE

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Example - HTML Element basefont</title>
    <basefont color="red" size="5" face="arial, sans-serif" />
</head>
<body>
    <h1>Heading Text</h1>
    <p>Some paragraph text goes here.</p>
</body>
</html>

Attributes

The following table shows the list of supported and unsupported attributes for the <basefont> element.

Attribute Type Details
Element-Specific Attributes The tag <basefont> has some element-specific attributes listed in the below table.
Global Attributes Like all other HTML tags, the tag <basefont> supports the HTML Global Attributes.
Event Attributes The tag <basefont> also supports the HTML Event Attributes.

Here is a list of attributes that are specific to the <basefont> element.

Attribute Value Required Description
color color No Obsolete
Specifies the default font color for the text in an HTML document.
face font-family No Obsolete
Specifies the default font face (or font family) for the text in an HTML document.
size number No Obsolete
Specifies the default font size for the text in an HTML document.

Browser Compatibility

The tag <basefont> is supported in all modern browsers.

  • Google Chrome x
  • Internet Explorer or Edge 5.5+
  • Firefox x
  • Apple Safari x
  • Opera x

Related Links