What Is The HTML Head Tag?

What Is The HTML Head Tag

Date First Published: 9th November 2022

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 4/10

Learn more about what the HTML head tag is in this article.

Not to be confused with a HTML heading tag.

The HTML head tag is a metadata container in a HTML document placed between the <html> and <body> tag. It is the first section of a HTML document and all of the metadata, including the meta title, description, keywords, character set, stylesheets, and other meta information is defined here. The meta information is visible in the source code, but not displayed in web browsers. Search engine bots read the information in this tag, so it is important that the title and description are relevant to the page. For more information, see this article.

All the metadata of the HTML document must be placed inside the <head> and </head> tags. New lines are often added to start new elements in the head section to differentiate between different elements, although putting all of the elements onto one line will not make any difference to how the metadata is rendered.

Note: Info Icon

The HTML head tag is required in all HTML documents.

Example Of A HTML Head

Below is an example of the usage of the HTML head tag in a HTML document.

<!DOCTYPE html> <html> <head> <title>Computerhelp4all.com</title> <meta name="description" content="This is a description."> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> </head> <body> <h1>Type your heading here.</h1> <p>This is an example of a HTML page with paragraphs.</p> <p>Paragraph 2</p> <p>Paragraph 3</p> </body> </html>


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.