Deprecated: This feature is no longer recommended. While some browsers may still support it, it may have already been removed from relevant web standards, may be in the process of being phased out, or may be retained only for compatibility reasons. Avoid using it and, if possible, update existing code; Please note that this feature may stop working at any time.

The HTML <basefont> element is deprecated. Sets a default font, size, and color for other elements that descend from its parent element. With this set, the font size can then be changed from the base size using the <font> element.

You should not use this item; instead, you should use CSS properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents.



This attribute sets the color of the text using a named color or a color specified in the hexadecimal format #RRGGBB.


This attribute contains a list of one or more character names. Document text in the default style is displayed in the first font supported by the client browser. If no listed fonts are installed on your local system, the browser typically defaults to the proportional or fixed-width font for that system.


This attribute specifies the font size as a numeric or relative value. Numeric values range from 1 to 7, with 1 being the smallest and 3 being the default.

Notes on usage

Do not use this item! Although once (inaccurately) normalized in HTML 3.2, it was not supported in all major browsers. Furthermore, browsers, and even subsequent browser versions, have never implemented it the same way: in practice, its use has always led to indeterminate results

The <basefont> element was deprecated in the standard at the same time as all style-only elements. Starting with HTML 4, HTML no longer conveys style information (outside of each element's <style> element or style attribute). In HTML5, this element has been completely removed. For any new web development, styling should be written using only CSS

The previous behavior of the <font> element can be achieved and controlled even better using the CSS Fonts properties.


  • HTML 3.2 supports the basefont element but only with the size attribute.
  • Strict HTML and XHTML specifications do not support this element.
  • Despite being part of the transition standards, some standards-focused browsers such as Mozilla and Opera do not support this element.
  • This element can be imitated with a CSS rule on the <body> element.
  • XHTML 1.0 requires a trailing slash for this element: <basefont />.