The HTML <head> tag
The HTML <head> element contains the document's metadata — the <title>, <meta> tags, <link>ed stylesheets and icons, and <script>s. This content is not displayed on the page.
Overview
The <head> element is the document's metadata container, sitting before the <body>. The browser processes its contents but does not render them as page content — it is information about the document rather than the document itself.
A well-formed head has a conventional order: the character encoding (<meta charset="utf-8">) first, then the responsive viewport <meta>, a unique <title>, a meta description, and finally <link>s to stylesheets and icons.
Only metadata-type elements belong here — <meta>, <link>, <style>, <script>, <base> and the <title> — and there must be exactly one <title>.
Syntax
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page title</title>
</head>
Example
<head>
<meta charset="utf-8">
<title>About — CodeShack</title>
<meta name="description" content="Learn about CodeShack.">
</head>
More Examples
Best practices
Frequently asked questions
What is the head element?
What goes in the head of an HTML document?
How many title elements can the head have?
What is the difference between head and body?
<head> holds non-rendered metadata; the <body> holds the visible page content.