DEV Community

Cover image for HTML tags | head
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tags | head

It contains machine-readable information (metadata) about the document. It must be the first element of an <html> element.

Metadata is not displayed and it typically defines the document title, character set, styles, scripts, and other meta information.

The following elements can go inside the <head> element:

  • <title> (required in every HTML document)
  • <style>
  • <base>
  • <link>
  • <meta>
  • <script>
  • <noscript>

The start tag may be omitted if the first thing inside the <head> element is an element. The end tag may be omitted if the first thing following the <head> element is not a space character or a comment.

HTML5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. This auto-creation is not guaranteed in ancient browsers.

  • Type: -
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Top comments (0)