Skip to the page
html reference · document

HTML <head> tag

closing tag
required
void element
no
lives inside
<html>, before <body>
typically holds
<title>, <meta>, <link>, <script>

Where it goes

The first thing inside <html>, before <body>.

Example

<head>
  <meta charset="utf-8">
  <title>My Page</title>
</head>

Open this example in the editor →

Common mistakes

  • Putting visible content (text, images, headings) inside <head>. Nothing in here shows on the page.
  • Forgetting <title> inside it. Every page needs one.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.