The <basefont> tag is used to specify a default font color, size or font family for all text in a web page. This basefont is applied to complete document or web page.
Note: <basefont> tag is deprecated from HTML. Alternate way is to use CSS instead.
Sample Code
<html>
<head>
<title>HTML basefont Tag with Example</title>
<basefont color="green" size="4" />
</head>
<body>
<p>basefont tag is deprecated from HTML. Alternate way to use CSS instead.</p>
</body>
</html>
<head>
<title>HTML basefont Tag with Example</title>
<basefont color="green" size="4" />
</head>
<body>
<p>basefont tag is deprecated from HTML. Alternate way to use CSS instead.</p>
</body>
</html>
Sample Result
basefont tag is deprecated from HTML. Alternate way to use CSS instead.
Tip: You can see the complete List of HTML Elements here.
Tag Specific Attributes Support
Following are few basefont tag attributes that are supported by <basefont> tag.
Attribute | Value | Description |
---|---|---|
color | #xxxxxx color_name |
Represents the default font color for the text |
face | font_family or font_name | Represents the default font family or name for the text |
size | number – 0 to 7 |
Represents the default font size for the text |
Standard Attributes Support
HTML <basefont> tag supports HTML Attributes. You can get more details about available HTML Attributes here.
Event Attributes Support
HTML <basefont> tag does not support Event Attributes. But you can get more details about available HTML Event Attributes here.