<head>
The <head> element contains machine-readable information (metadata) about the document, such as the title, <script> and <style> elements, and <meta> elements. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Overview
The <head> element contains machine-readable information (metadata) about the document, such as the title, <script> and <style> elements, and <meta> elements. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | 1 | 18 | 1 | |
| DOM API | ||||||
| The HTMLHeadElement interface contains the descriptive information, or metadata, for a document. This object inherits all of the properties and methods described in the HTMLElement interface. | 1 | 12 | 1 | 1 | 18 | 1 |
Syntax
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
<link rel="stylesheet" href="style.css">
</head> Live demo
Visible vs non-visible content
Contrast head-only metadata with content that belongs in the body.
Head authoring checklist
Keep the document head focused on metadata and resource hints.
Use cases
Strengthen structure
Use <head> to make the document outline, grouping, or semantics more explicit.
Improve meaning
Apply <head> when clearer HTML structure helps users and tools understand the content.
Cautions
- Test <head> in your target browsers and input environments before depending on it as a primary behavior.
Accessibility
- Prefer semantic structure that improves navigation and interpretation for assistive technologies, not just visual organization.
Related links
Powered by web-features