Search w3schools.com:

SHARE THIS PAGE

HTML <basefont> Tag. Not Supported in HTML5.


Example

Specify a default font-color and font-size for text on page:

<head>
<basefont color="red" size="5" />
</head>

<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <basefont> tag is only supported in Internet Explorer 9, and earlier versions.


Definition and Usage

The <basefont> tag is not supported in HTML5. Use CSS instead.

The <basefont> element is deprecated in HTML 4.01.

The <basefont> tag specifies a default font-color, font-size, or font-family for all the text in a document.


Tips and Notes

Tip: Use CSS to specify a default font-color, font-size, and font-family for the text in a document.


Differences Between HTML 4.01 and HTML5

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


Optional Attributes

Attribute Value Description
color color Not supported in HTML5. Deprecated in HTML 4.01. Specifies the default color for text in a document
face font_family Not supported in HTML5. Deprecated in HTML 4.01. Specifies the default font for text in a document
size number Not supported in HTML5. Deprecated in HTML 4.01. Specifies the default size of text in a document


Standard Attributes

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

Attribute Value Description
class classname Specifies a classname for an element
dir rtl
ltr
Specifies the text direction for the content in an element
id id Specifies a unique id for an element
lang language_code Specifies a language code for the content in an element
style style_definition Specifies an inline style for an element
title text Specifies extra information about an element

More information about Standard Attributes.


Event Attributes

The <basefont> tag does not support any event attributes in HTML 4.01.

More information about Event Attributes.



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]