The <head>
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 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 |
This element includes the global attributes.
profile
<!doctype html> <html> <head> <title>Document title</title> </head> </html>
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.
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of '<head>' in that specification. | Living Standard | No change from latest shapshot |
HTML5 The definition of '<head>' in that specification. | Recommendation | Obsoleted profile
|
HTML 4.01 Specification The definition of '<head>' in that specification. | Recommendation |
Desktop | ||||||
---|---|---|---|---|---|---|
head |
1 | 12 | 1 | Yes | Yes | Yes |
profile
|
1 | 12 | 1 | Yes | Yes | Yes |
Mobile | ||||||
---|---|---|---|---|---|---|
head |
Yes | Yes | 4 | Yes | Yes | Yes |
profile
|
Yes | Yes | 4 | Yes | Yes | Yes |
<head>
:
© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head