HTML <basefont> Tag

The <basefont> tag specifies the default font size and color of the text. It can be used several times inside <head> or <body> tags.

The <basefont> tag is not supported in HTML5.

Syntax

The <basefont> tag is an empty tag, it comes without a closing tag. However, in XHTML closing the tag (<basefont/>) is required.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the documnet</title>
    <basefont color="green" face="Helvetica" size="14">
  </head>
  <body>
    <h3>Title of the text.</h3>
    <p>Paragraph of the text.</p>
  </body>
</html>

Tip: To achieve the former behavior of the <basefont> use CSS font, font-family, font-size and color properties.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the documnet</title>
    <style>
      body {
        color: #8ebf42; 
        font-size: 14px;
        font-family: Helvetica;
      }
    </style>
  </head>
  <body>
    <h3>Title of the text.</h3>
    <p>Paragraph of the text.</p>
  </body>
</html>

Attributes

Attribute Value Description
color color Sets the default text color.
Not supported in HTML5.
face font_family Defines the font of the text.
Not supported in HTML5.
size number Specifies the font size.
Not supported in HTML5.