(Not Supported in HTML5)
HTML <basefont> tag was used to specify the default value of font-size, color, and font-family for all content written within an HTML document.
Syntax:
<basefont color="blue" size="5" face="arial">
In HTML the closing tag </basefont> is not required but in XHTML the end tag is required.
Following are some specifications about the <base> tag
| Display | None (empty tag) |
| Start tag/End tag | Only start-tag |
| Usage | Font styling |
Example:
<!DOCTYPE html>
<html>
<head>
<title>Basefont tag</title>
<basefont color="blue" size="5" face="arial">
</head>
<body>
<h2>Example of Basefont tag</h2>
<p>The basefornt tag is not supported in HTML5 use CSS to style the document</p>
</body>
</html>
Right way is to Use CSS to set the base font:
<!DOCTYPE html>
<html>
<head>
<style>
p{
font-size: 20px;
color: #67dfee;
font-family: Helvetica;
}
</style>
</head>
<body>
<h2>CSS to Style the document</h2>
<p>This is Paragraph</p>
</body>
</html>
Attributes
Tag specific attributes:
| Attribute | Value | Description |
|---|---|---|
| color | color | Specify the default color of all text within an HTML document. (Not Supported in HTML5) |
| face | font-family | Specify the default font face for the text in the document. (Not Supported in HTML5) |
| size | number | Specify the size of the text. (Not Supported in HTML5) |
Supporting Browsers
| Element | Chrome | IE | Firefox | Opera | Safari |
| <basefont> | No | No | No | No | No |
Chrome
IE
Firefox
Opera
Safari