<basefont>

The <basefont> tag defined a default font size and color for text in HTML, but it's no longer supported in HTML5, encouraging CSS usage instead.

basefont tag

The <basefont> tag in HTML was originally designed to define a default font size and color for an entire document or specific sections, ensuring consistency in text appearance. However, this element has been deprecated in HTML5 and is no longer recommended for modern web development.

Syntax

index.html
<basefont size="value" color="color" face="font-family">

<basefont> Demo

basefont
index.html
<basefont size="3" color="blue" face="Arial">
  basefont
</basefont>

Key Points

  • Purpose: Specifies a default font size and color for text.
  • Attributes:
    • size: Defines the font size (range: 1 to 7).
    • color: Sets the text color.
    • face: Specifies the font family (e.g., Arial, Verdana).
  • Deprecation: No longer supported in HTML5; CSS should be used instead.

Attributes

AttributeValueDescription
colorcolorSets the default text color (obsolete in HTML5).
facefont_familySpecifies the font type (obsolete in HTML5).
sizenumberDetermines the font size (obsolete in HTML5).

Conclusion

The <basefont> tag was once used to control text appearance within an HTML document. However, it has been deprecated in HTML5 and should no longer be used. Instead, CSS provides a more flexible and widely supported method for styling fonts. The attributes size, color, and face are now obsolete, reinforcing the use of CSS for defining font properties in modern web design.