<head>

  • Revision slug: HTML/Element/head
  • Revision title: head
  • Revision id: 287224
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment +ja; 14 words added, 5 words removed

Revision Content

Summary

The HTML <head> element represents a collection of metadata about the document, including links to or definitions of scripts and style sheets.

Usage context

Content categories None.
Permitted content One {{ HTMLElement("title") }} element, an optional {{ HTMLElement("base") }} element, and any number of metadata elements, in any order. In HTML5, the {{ HTMLElement("object") }} is no longer allowed as a child of <head>.
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 parent elements {{ HTMLElement("html") }}
Normative document HTML 5, section 4.2.1HTML 4.01, section 7.4.1

Attributes

Like all HTML elements, this element accepts the global attributes.

{{ htmlattrdef("profile") }} {{ HTMLVersionInline(4) }} only, {{ obsolete_inline() }} in {{ HTMLVersionInline(5) }}
The URIs of one or more metadata profiles, separated by white space.

DOM interface

This element implements the HTMLHeadElement interface.

Example

<html>
  <head>
    <title>Document title</title>
  </head>
</html>

Notes

Most browsers automatically construct a <head> element if the tags are omitted in the markup. However some do not.
These browsers were tested as not creating a head element automatically: Android <=1.6, iPhone <=3.1.3, Nokia 90, Opera <=9.27, and Safari <=3.2.1.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}

See also

  • Elements that can be used inside a <head> element: {{ HTMLElement("title") }}, {{ HTMLElement("base") }}, {{ HTMLElement("link") }}, {{ HTMLElement("style") }}, {{ HTMLElement("meta") }}, {{ HTMLElement("script") }}, {{ HTMLElement("noscript") }}, {{ HTMLElement("command") }}
{{ HTML:Element_Navigation() }}
{{ languages({ "ja": "ja/HTML/Element/head", "de": "de/HTML/Element/head"}) }}

Revision Source

<h2 id="Summary">Summary</h2>
<p>The HTML <code>&lt;head&gt;</code> element represents a collection of metadata about the document, including links to or definitions of scripts and style sheets.</p>
<h2 id="Usage_context">Usage context</h2>
<table class="standard-table"> <tbody> <tr> <td><a href="/en/HTML/Content_categories" title="en/HTML/Content categories">Content categories</a></td> <td>None.</td> </tr> <tr> <td>Permitted content</td> <td>One {{ HTMLElement("title") }} element, an optional {{ HTMLElement("base") }} element, and any number of <a href="/en/HTML/Content_categories#metadata_content" title="en/HTML/Content categories#metadata content">metadata elements</a>, in any order. In HTML5, the {{ HTMLElement("object") }} is no longer allowed as a child of <code>&lt;head&gt;</code>.</td> </tr> <tr> <td>Tag omission</td> <td>The start tag may be omitted if the first thing inside the head element is an element.<br> The end tag may be omitted if the first thing following the head element is not a space character or a comment.</td> </tr> <tr> <td>Permitted parent elements</td> <td>{{ HTMLElement("html") }}</td> </tr> <tr> <td>Normative document</td> <td><a class="external" href="http://www.w3.org/TR/html5/semantics.html#the-head-element-0" title="http://www.w3.org/TR/html5/semantics.html#the-head-element-0">HTML 5, section 4.2.1</a>;  <a class="external" href="http://www.w3.org/TR/html401/struct/global.html#h-7.4.1" title="http://www.w3.org/TR/html401/struct/global.html#h-7.4.1">HTML 4.01, section 7.4.1</a></td> </tr> </tbody>
</table>
<h2 id="Attributes">Attributes</h2>
<p>Like all HTML elements, this element accepts the <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>.</p>
<dl> <dt>{{ htmlattrdef("profile") }} {{ HTMLVersionInline(4) }} only, {{ obsolete_inline() }} in {{ HTMLVersionInline(5) }}</dt> <dd>The URIs of one or more metadata profiles, separated by white space.</dd>
</dl>
<h2 id="DOM_interface">DOM interface</h2>
<p>This element implements the <a href="/en/DOM/HTMLHeadElement" title="en/DOM/HTMLHeadElement">HTMLHeadElement</a> interface.</p>
<h2 id="Example">Example</h2>
<pre class="brush: html">&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Document title&lt;/title&gt;
  &lt;/head&gt;
&lt;/html&gt;
</pre>
<h2 id="Notes">Notes</h2>
<p>Most browsers automatically construct a <code>&lt;head&gt;</code> element if the tags are omitted in the markup. <a class="external" href="http://www.stevesouders.com/blog/2010/05/12/autohead-my-first-browserscope-user-test/" title="http://www.stevesouders.com/blog/2010/05/12/autohead-my-first-browserscope-user-test/">However some do not.</a><br> These browsers were tested as not creating a head element automatically: Android &lt;=1.6, iPhone &lt;=3.1.3, Nokia 90, Opera &lt;=9.27, and Safari &lt;=3.2.1.</p>
<h2 id="Browser_Compatibility" name="Browser_Compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> </tr> </tbody> </table>
</div>
<div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> <td>{{ CompatVersionUnknown() }}</td> </tr> </tbody> </table>
</div>
<h2 id="See_also">See also</h2>
<ul> <li>Elements that can be used inside a <span style="font-family: Courier New;">&lt;head&gt;</span> element: {{ HTMLElement("title") }}, {{ HTMLElement("base") }}, {{ HTMLElement("link") }}, {{ HTMLElement("style") }}, {{ HTMLElement("meta") }}, {{ HTMLElement("script") }}, {{ HTMLElement("noscript") }}, {{ HTMLElement("command") }}</li>
</ul> <div>{{ HTML:Element_Navigation() }}</div>
<div>{{ languages({
"ja": "ja/HTML/Element/head",
"de": "de/HTML/Element/head"}) }}
</div>
Revert to this revision