HTML元素 - title

定义

文档的标题。

Contains the title of the document.

注释

TITLE 元素仅可在 HEAD 元素内使用。位于 TITLE 开闭标签之内的文本都会在浏览器的标题栏和 Microsoft Windows 的任务栏上显示。对于 Web 页,“Internet Explorer”会被自动追加到标题后。而在 HTML 应用程序(HTA)中,仅会显示指定的标题。

要使用脚本在程序中设置标题,请使用 document.title 而不是设置 title 对象的 innerHTML 属性。

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。

此元素是块元素。

此元素需要关闭标签。

The TITLE element can be used only within the HEAD element. Any text between the opening and closing TITLE tags displays in the browser title bar and in the Microsoft Windows taskbar. In Web pages, "Internet Explorer" is appended to the title. In an HTML Application (HTA), by contrast, only the specified title appears.

To set the title programmatically using script, use document.title instead of setting the innerHTML property of the title object. For more information, see Q296113: Script Fails to Change the Document Title of a Web Page.

This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

This element is a block element.

This element requires a closing tag.

示例代码

<HEAD>
<TITLE>欢迎来到asp之家网站!</TITLE>
</HEAD>