Latest web development tutorials

HTML <basefont> tag

Examples

A predetermined default page size and color of the text:

<head>
<basefont color="red" size="5" />
</head>

<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only IE 9 and earlier versions of IE browsers support <basefont> tag. You should avoid using the label.


Tag definitions and instructions

HTML5 does not support <basefont> tag. Please be replaced with CSS.

In HTML 4.01, <basefont> element is obsolete .

<Basefont> tag defines the document default color of all the text, and font size.


Tips and Notes

Tip: Use CSS for the text specified in the document default color, size and font .


Differences between HTML 4.01 and HTML5

HTML5 does not support <basefont> tag, HTML 4.01 obsolete <basefont> tag.


Optional attributes

属性 描述
color color HTML5 不支持。 HTML 4.01 已废弃。 规定文档中文本的默认颜色。
face font_family HTML5 不支持。 HTML 4.01 已废弃。 规定文档中文本的默认字体。
size number HTML5 不支持。 HTML 4.01 已废弃。 规定文档中文本的默认大小。


Standard property

In HTML 4.01, <basefont> tag supports the following standard attributes:

属性 描述
class classname 规定元素的类名
dir rtl
ltr
规定元素中内容的文本方向
id id 规定元素的唯一 id
lang language_code 规定元素中内容的语言代码
style style_definition 规定元素的行内样式
title text 规定元素的额外信息

For a full description, go to Standard property .


Event Properties

In HTML 4.01, <basefont> tag does not support any event attributes.

For a full description, go to Event Attributes .