HTML Head Tag

The HTML head tag is used to specify content for the head of the HTML document called the HTML header. The HTML header element is the first element in an HTML document. An HTML head tag is simply a the word "head" bracketed by less than "<" and greater than ">" characters. Everything between the two HTML head tags <head> and <head> is part of the HTML head element. The HTML header element contains several elements which help perform several functions including:

  • Providing a title, description, and list of keywords on the page which is used by search engines to describe the page and help determine useful content.
  • Determine scripts than can be run when the page loads or unloads.
  • Specify how often the page will be reloaded.
  • Specify an expiration date for the web page after which data is not considered to be reliable.

One title element is to be included in each HTML head element. Other elements in the HTLM head element are optional. The items in the HTML head element are not shown in the browser except the title of the document which is shown at the top of the browser.

HTML Header Elements

Elements allowed in the HTML 4.0 strict "head" element include:

  • base - Defines the base location for resources in the current HTML document. Supports the TARGET attribute in frame and transitional document type definitions.
  • link - Used to set relationships of other documents with this document such as the location and file name of a style sheet.
  • meta - Used to set specific characteristics of the web page and provide information to readers and search engines.
  • script - Used to embed script in the header of an HTML document such as javascript code which will be run either when the page is loaded, unloaded or the user performs some action.
  • style - Used to embed style sheet information in the HTML document.
  • title - The content of this element sets the document title. This element is required once inside the HTML head element.
The additional element allowed by the HTML 4.0 transitional standard is:
  • isindex (Depreciated) - Allows a single line of text input. Use the INPUT element rather than ISINDEX.