<head>: The Document Metadata (Header) element #
::: section-content
The <head>
HTML element contains machine-readable
information
(
metadata)
about the document, like its
title,
scripts, and
style sheets.
::: {#sect1 .notecard .note}
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.
:::
:::
Attributes #
::: section-content This element includes the global attributes.
profile
[Deprecated]{.visually-hidden} [Non-standard]{.visually-hidden}The URIs of one or more metadata profiles, separated by white space. :::
Examples #
::: section-content ::: code-example [html]{.language-name}
<!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 #
::: section-content
Content categories | None. |
---|---|
Permitted content | If the document is an Otherwise, one or more elements of metadata content where exactly one
is a |
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 <html> element, as its
first child. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | No role permitted |
DOM interface | HTMLHeadElement |
Specifications #
::: _table #
Specification #
HTML Standard
[#
the-head-element]{.small}
:::
Browser compatibility #
::: _table Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
head
1 12 1 Yes 15 1 4.4 18 4 14 1 1.0
profile
1 12 1 Yes 15 1–16.4 4.4 18 4 14 1–16.4 1.0
:::
See also #
::: section-content
- Elements that can be used inside the
<head>
:
::: _attribution
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5
or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head{._attribution-link}
:::