The <head>
provides general information (metadata) about the document, including its title and links to its scripts and style sheets.
Content categories | None. |
---|---|
Permitted content | If the document is an <iframe> srcdoc document, or if title information is available from a higher level protocol, zero or more elements of metadata content.Otherwise, one or more elements of metadata content where exactly one is a <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 <html> element, as its first child. |
Permitted ARIA roles | None |
DOM interface | HTMLHeadElement |
This element includes the global attributes.
profile
<html> <head> <title>Document title</title> </head> </html>
Modern, HTML5-compliant browsers automatically construct a <head>
element if the tags are omitted in the markup. This behavior cannot be 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 | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 1 | Yes | 1 | Yes | Yes | Yes |
profile
|
1 | Yes | 1 | Yes | Yes | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | 4 | Yes | Yes | Yes |
profile
|
Yes | Yes | Yes | 4 | Yes | Yes | Yes |
<head>
element: <title>
, <base>
, <link>
, <style>
, <meta>
, <script>
, <noscript>
, <template>
© 2005–2018 Mozilla Developer Network 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