HTML <basefont>Tag -Not supported in HTML5
Examples
Sets the default color and size of text on the page:
<basefont color="red" size="5" />
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
Try it Yourself »
Browser Support
![]()
Only IE 9 and earlier versions of IE browsers support the <basefont> tag. This tag should be avoided.
Tag Definition and Usage
HTML5 does not support the <basefont> tag. Use CSS instead.
In HTML 4.01, the <basefont> elementis deprecated。
The <basefont> tag defines the default color, size, and font for all text in the document.
Tips and Notes
Tip:Use CSS to specify the text in the documentdefault color, size, and font。
Differences between HTML 4.01 and HTML5
HTML5 does not support the <basefont> tag, and HTML 4.01 has deprecated the <basefont> tag.
Optional Attributes
| Attribute | Value | Description |
|---|---|---|
| color | color | Not supported in HTML5. Deprecated in HTML 4.01.Sets the default color of text in the document. |
| face | font_family | Not supported in HTML5. Deprecated in HTML 4.01.Sets the default font for text in the document. |
| size | number | Not supported in HTML5. Deprecated in HTML 4.01.Sets the default size of text in the document. |
Standard Attributes
In HTML 4.01, the <basefont> tag supports the following standard attributes:
| Attribute | Value | Description |
|---|---|---|
| class | classname | Sets the class name of the element |
| dir | rtl ltr |
Sets the text direction of the content within the element |
| id | id | Sets the unique id of the element |
| lang | language_code | Sets the language code of the content within the element |
| style | style_definition | Sets the inline style of the element |
| title | text | Sets extra information about the element |
For a complete description, visitStandard Attributes。
Event Attributes
In HTML 4.01, the <basefont> tag does not support any event attributes.
For a complete description, visitEvent Attributes。
Other Extensions