Search w3schools.com:

SHARE THIS PAGE

HTML <basefont> face Attribute

HTML basefont Tag Reference HTML <basefont> tag

Example

Specify the default font for text on page:

<head>
<basefont face="courier, serif" />
</head>

<body>
<h1>This is a header</h1>
<p>This is a paragraph</p>
</body>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The face attribute 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 face attribute of <basefont> is deprecated in HTML 4.01.

The face attribute specifies the default font for the text in a document.

Tip: The value of the face attribute can hold several font names as a "fallback" system. List the font that you want first, followed by any fonts that can fill in for the first, if it is unavailable. You should end the list with a generic font (serif, sans-serif, monospace, cursive or fantasy), to let the browser pick a font that is in the generic family, if no other fonts are available.


Compatibility Notes

The face attribute of <basefont> is deprecated in HTML 4.01. Use CSS instead.

CSS syntax (in the <head> section): <style>body{font-family: courier, serif}</style>

CSS Example: Specify a default font for a page

In our CSS tutorial you can find more details about the font-family property.


Syntax

<basefont face="font_family" />

Attribute Values

Value Description
font_family The font of the text. To specify a prioritized list of several fonts, separate the names with a comma (like this <basefont face="verdana,arial,sans-serif" />


HTML basefont Tag Reference HTML <basefont> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]