English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML: <basefont> Tag

The HTML tag <basefont> is used to set the default font size of the document. You can change the font size relative to the default size using <font>.

Do not use this tag anymore!

Online Example

Define the default color and size of text on the page:

<head>
	<basefont color="red" size="5" />
	</head>
<body>
	<h1>This is a heading</h/h1>
	<p>This is a paragraph.</p>/p>
	</body>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Only IE 9 And earlier versions of IE browsers support the <basefont> tag. It is recommended to avoid using this tag.

Tag Definition and Usage

HTML5 The <basefont> tag is not supported. Please use CSS instead.

In HTML 4.01 In HTML, the <basefont> element is deprecated.

The <basefont> tag defines the default color, size, and font for all text in the document.

Tips and Notes

Tip:Define the default color, size, and font of text in the document using CSS.

HTML 4.01 with HTML5differences

HTML5 The <basefont> tag is not supported, HTML 4.01 The <basefont> tag is deprecated.

Optional Attributes

AttributeValueDescription
colorcolorHTML5 Not supported. HTML 4.01 Deprecated.    specify the default color of the text in the document
facefont_familyHTML5 Not supported. HTML 4.01 Deprecated. specify the default font of the text in the document
sizenumberHTML5 Not supported. HTML 4.01 Deprecated. specify the default size of the text in the document

Standard Attributes

In HTML 4.01 In the <basefont> tag supports the following standard attributes:

AttributeValueDescription
classclassnamespecify the class name of the element
dirrtl
ltr
specify the text direction of the content within the element
ididspecify the unique id of the element
langlanguage_codespecify the language code for the content within the element
stylestyle_definitionspecify the inline style of the element
titletextspecify additional information about the element

For a complete description, please visitStandard Attributes.

Event Attributes

In HTML 4.01 where, the <basefont> tag does not support any event attributes.

For a complete description, please visitEvent Attributes.