Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/html/element/head/index.md
6524 views
---
title: '<head>: The Document Metadata (Header) element' slug: Web/HTML/Element/head page-type: html-element browser-compat: html.elements.head
---

{{HTMLSidebar}}

The <head> HTML element contains machine-readable information ({{glossary("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 {{HTMLElement("header")}} element.

Attributes

This element includes the global attributes.

  • profile {{deprecated_inline}} {{Non-standard_Inline}}

    • : The {{glossary("URI")}}s of one or more metadata profiles, separated by {{Glossary("whitespace", "white space")}}.

Example

<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width" /> <title>Document title</title> </head> </html>

Technical summary

Content categories None.
Permitted content

If the document is an {{HTMLElement("iframe")}} {{htmlattrxref("srcdoc", "iframe")}} 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 {{HTMLElement("title")}} element.

Tag omission The 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 parents An {{HTMLElement("html")}} element, as its first child.
Implicit ARIA role No corresponding role
Permitted ARIA roles No role permitted
DOM interface {{domxref("HTMLHeadElement")}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Elements that can be used inside the <head>:

    • {{HTMLElement("title")}}

    • {{HTMLElement("base")}}

    • {{HTMLElement("link")}}

    • {{HTMLElement("style")}}

    • {{HTMLElement("meta")}}

    • {{HTMLElement("script")}}

    • {{HTMLElement("noscript")}}

    • {{HTMLElement("template")}}