<head>: The Document Metadata (Header) element - HTML: HyperText Markup Language 编辑

The HTML <head> element contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets.

Note: <head> primarily holds information for machine processing, not human-readability. For human-visible information, like top-level headings and listed authors, see the <header> element.

Content categoriesNone.
Permitted content

If the document is an <iframe> srcdoc document, or if title information is available from a higher level protocol (like the subject line in HTML email), zero or more elements of metadata content.

Otherwise, one or more elements of metadata content where exactly one is a <title> element.

Tag omissionThe start tag may be omitted if the first thing inside the <head> element is an element.
The end tag may be omitted if the first thing following the <head> element is not a space character or a comment.
Permitted parentsAn <html> element, as its first child.
Implicit ARIA roleNo corresponding role
Permitted ARIA rolesNo role permitted
DOM interfaceHTMLHeadElement

Attributes

This element includes the global attributes.

profile This is an obsolete API and is no longer guaranteed to work.
The URIs of one or more metadata profiles, separated by white space.

Example

<!doctype html>
<html>
  <head>
    <title>Document title</title>
  </head>
</html>

Notes

HTML5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. This auto-creation is not guaranteed in ancient browsers.

Specifications

SpecificationStatusComment
HTML Living Standard
The definition of '<head>' in that specification.
Living StandardNo change from latest shapshot
HTML5
The definition of '<head>' in that specification.
RecommendationObsoleted profile
HTML 4.01 Specification
The definition of '<head>' in that specification.
Recommendation

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:63 次

字数:7043

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文