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 <title> element, an optional <base> element, and any number of metadata elements, in any order. In HTML5, the <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 | <html> |
| Normative document | HTML 5, section 4.2.1; HTML 4.01, section 7.4.1 |
Attributes
Like all HTML elements, this element accepts the global attributes.
profileHTML 4 only, Obsolete in HTML5- 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
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | (Yes) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
See also
- Elements that can be used inside a <head> element:
<title>,<base>,<link>,<style>,<meta>,<script>,<noscript>,<command>


Mozilla Developer Network