This website uses cookies

We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. Please read more at our privacy policy page.



HTML <basefont> Tag

The <basefont> tag specifies the default font size and color of the text. It can be used several times inside the <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>

Result

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 document</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>

Result

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.

Browser support