HTML <head> Tag

By Jonathan Griffin. Editor, SEO Consultant, & Developer.

· 2 min read


The <head> element contains a collection of metadata relating to the web page or document.


<!DOCTYPE html>
    <title>HTML Title Element goes here.</title>
    <h1>Displayed Page Title</h1>
    <p>The main content of your page goes here.</p>


  • The <head> element is placed between the <html> and <body> elements.
  • The <head> element must include a <title> element (unless the document is an iframe srcdoc document or if title information is available from a higher-level protocol).
  • The <head> element must not contain more than one <base> element.
  • The following elements can go inside the <head> element:
  • If the first item inside the opening <head> tag is an element then the start tag may be omitted.
  • The end tag may be omitted if the first item following the end <head> tag is not a space or a comment.


The <head> element only supports the Global Attributes.

Best Practices

  • It primarily holds data that is processed by browsers, robots, and other user-agents. For human-readable information that includes the top-level heading, author information, breadcrumbs, etc, see the <header> element.
  • You should keep the use of attributes and associated values defined on the <head> element to a minimum. This allows for proper detection of the character encoding declaration (e.g. <meta charset="utf-8"/>) within the first 1024 bytes.


Browser Support




Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet