Tag <basefont>

The <basefont> tag was used in HTML 4 to specify a default text-color, font-size or font-family for all the text in an HTML document.


Example

Specify a default text-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>


Definition and Usage

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

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


Browser Support

Element
<basefont> Not supported Not supported Not supported Not supported Not supported

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


Differences Between HTML 4.01 and HTML5

The <basefont> tag is not supported in HTML5.


Compatibility Notes

Example

Specify a default text-color for a page (with CSS):

<html>
<head>
<style>
body {
color: red;
}
</style>
</head>
<body>

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

</body>
</html>

Example

Specify a default font-family for a page (with CSS):

<html>
<head>
<style>
body {
font-family: courier, serif;
}
</style>
</head>
<body>

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

</body>
</html>

Example

Specify a default font-size for a page (with CSS):

<html>
<head>
<style>
body {
font-size: 50px;
}
</style>
</head>
<body>

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

</body>
</html>


Optional Attributes

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