HTML <head> Head Tag Reference

Every HTML page should have one head tag, followed by a <body> tag, and contains the non-visible information about your HTML document.

The <head> HTML/xHTML tag

The head section of an HTML page is the first non-visible section that contains various tags that describe the document's content, structure, relationship to other files, and display rules.

When to use the <head> tag (semantic use)

Every HTML page should have a <head></head> section, which comes before the <body></body> section.

Head sections typically contain the following tags:

  • <style to call in external stylesheets, or define CSS styles within the scope of the current document only.
  • <titie> an essential tag that describes the page's purpose and content
  • <link> for defining relationships between the document and other documents (like stylesheets, or other documents)
  • <script> for including JavaScript code on the page, or for including an external JavaScript file.
  • <meta> for defining hidden descriptive data for the page. Most common and useful is the meta description.

It's valid in all versions of HTML and xHTML, and it should always have a closing </head tag.

Example of <head> tag use

<html>
<head>
... hidden tags ...
</head>
<body>
... visible content ...
</body>
</html>