Widely availableSuitable for production when it improves semantics, input, or browser integration.

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
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<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

Head metadata map

List the kinds of information that belong in the document head.

PreviewFullscreen

Visible vs non-visible content

Contrast head-only metadata with content that belongs in the body.

PreviewFullscreen

Head authoring checklist

Keep the document head focused on metadata and resource hints.

PreviewFullscreen

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.

Powered by web-features