HTML <basefont> Tag

Not supported in HTML5.

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

What to replace with?

Example 1

Specify the default text color of the page (using CSS):

<html>
<head>
<style>
body {
  color: red;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>

Try it yourself

Example 2

Specify the default font family of the page (using 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>

Try it yourself

Example 3

Specify the default font size of the page (using 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>

Try it yourself

Tip:In our CSS tutorial, you can learn about CSS Text Color and CSS Font for more information.