The HTML head is the part of a document that holds metadata—data about the page—such as the document title, character encoding, description, and links to CSS or JavaScript. Users do not see head content as page text; browsers, search engines, and social apps read it to configure how the page behaves and appears elsewhere.
How is this page different from the <head> tag reference?
This tutorial focuses on what to put in the head and why (webpage metadata). For element syntax, attributes, and technical rules, use the <head> tag reference.
What does webpage metadata do?
Metadata sets the browser tab title, tells phones how to scale the layout, helps search results show a useful snippet, loads stylesheets and scripts, and controls link previews when someone shares your URL.
When do you edit the head?
On every new HTML page: declare charset and viewport, write a unique <title>, add a description when the page should appear in search, then link CSS (and scripts with defer when needed).
Invisible on the page, visible everywhere else.
Tab titles, bookmarks, search snippets, and social cards all come from head metadata—not from the visible <h1>.
<title> ≠ <h1>.
title is document metadata. h1 is a visible heading in <body>. Use both; do not treat them as the same thing.
Language lives on <html>.
Set lang on the opening <html> tag (for example lang="en"). That is part of building a correct document alongside the head.
Syntax
HTML Syntax for a Starter Head
A minimal modern head sits inside <html>, before <body>:
Pick a metadata piece and see where it shows up (tab, search, styles, or share card)—not as body text.
Simulates where each head tag is consumed—body content stays separate.
Where this metadata appears
🔖 Browser tab: My First Page
<title>My First Page</title>
Code
HTML Examples
Six metadata patterns: minimal head, SEO meta, linked CSS, internal CSS, social tags, and a complete head.
Example 1 — Minimal Head (Charset, Viewport, Title)
Every new HTML page should start with these three metadata pieces:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>Check the browser tab — the title comes from the head.</p>
</body>
</html>
The head holds metadata and linked resources. Visible content lives in body.
How It Works
Metadata first — encoding, viewport, description, title.
Resources next — stylesheet, favicon, optional internal CSS.
defer — script runs after HTML is parsed, in order.
Body stays clean — only the content users should read and click.
Edge Cases & Pitfalls
Metadata mistakes rarely show as red errors—they show as wrong tabs, broken mobile layout, or missing snippets.
title
Missing or duplicate <title>
Normal HTML documents need exactly one title. Duplicate titles across pages hurt bookmarks and SEO clarity.
charset
Charset declared too late
Put <meta charset> early in head so the browser does not mis-decode the first chunk of the file.
body
Visible content in head
Headings, paragraphs, and images belong in body. Head is for machines and resource links.
header
Confusing head with header
<head> is metadata. <header> is a visible landmark in the body (logo, nav intro).
keywords
Relying on meta keywords
Spend effort on title, description, and content quality—not keyword stuffing meta tags.
script
Blocking scripts in head
A script without defer/async in head can delay first paint. Prefer defer for page scripts.
Compatibility
Browser Support
Document metadata in the HTML head — title, meta, link, style, and script — is supported in all modern browsers.
✓ Baseline · Widely available
Webpage metadata in HTML
Browsers read the head for encoding, title, stylesheets, and scripts on every device users browse today.
100%head metadata support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
HTML head metadataUniversal
Bottom line: Focus on correct metadata content—browser support for the head container is not the limiting factor.
Remember
Key Takeaways
Head = metadata about the document, not visible page copy.
Start with charset, viewport, and a unique <title>.
title ≠ h1 — tab/search vs on-page headline.
Link CSS/JS from head; use defer for most scripts.
One line: Build the head for machines (title, charset, viewport, description, CSS/JS links); build the body for people.
Frequently Asked Questions
The head is the part of an HTML document that holds metadata about the page — title, character encoding, description, and links to CSS or JavaScript. It is not displayed as page content; browsers and other tools read it to configure the document.
This page is a webpage-metadata tutorial: what to put in the head and why (title vs h1, charset, SEO description, favicons, CSS/JS, social tags). The head tag reference covers the element’s syntax, attributes, and technical rules.
The title element is document metadata — browser tab, bookmarks, and often search results. An h1 is a visible heading in the body for the page’s main topic. They serve different jobs and both belong in a well-structured page.
Put metadata and resource links in head: title, meta, link, style, and many script tags. Put all visible content in body: headings, paragraphs, images, and UI. Never put h1 or p inside head.
Major search engines largely ignore meta keywords because they were abused. Focus on a unique title, a clear meta description, semantic HTML, and useful content.
Set lang on the opening html element (for example html lang="en"), not only inside head. That helps search engines and assistive technologies pronounce and index the document correctly.