<head> HTML Tag

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more

Sharing is caring!

Element of
HTML Document Structure Before And After HTML5 – Here’s What Changed
What does <head> HTML Tag do?
The <head> element contains information about an HTML document that is used by browsers and web crawlers but is not displayed to website visitors.

What to put in the <head>

The purpose of the document <head> is to provide information about the document itself.

Semantic Information

  • <title>
  • <meta>, especially keywords, a description, and Open Graph details.
  • Relevant rel= links`, especially canonical URLs, links to RSS Feeds, and links to translations.
  • Presentational and Functional Information

  • Doctype declaration
  • Character Set declaration
  • Link(s) to CSS
  • Link to a Favicon
  • An “HTML5 shiv”
  • Javascript that must be at the top of the page
  • Placement of JavaScript

    It was once very common to place all JS into the <head>, however that is no longer recommended practice because it can slow down page load. Today, the typical recommendation is to place JavaScript at the end of the <body> element whenever possible.

    Adam is a technical writer who specializes in developer documentation and tutorials.

    Browser Support for head