1. Home
  2. Computing & Technology
  3. Web Design / HTML

What is the HEAD Tag For?

The Top of Your Pages

By Jennifer Kyrnin, About.com

When I speak of the top of your Web pages, I am not referring to the first few lines of text that your readers see, but the hidden information contained in HTML tags that tells the browsers and search engines many things.

Technically, there is only one tag that is required to be at the top of all HTML documents: the <title> tag. This required tag is only valid within the <head> tag, which is only valid within the <html> tag.

In other words, the first three lines of all HTML documents should look like this:

<html>
<head>
<title>

You can also include a doctype tag above the <html>.

<title>

You should always include a <title></title> on your Web page. As I said above, it is required, but there are two other good reasons to do it:

  1. Search engines use the title as one of their primary means of cataloging sites. If your Web page doesn't have a descriptive title the search engines will give it a much lower ranking than other pages.
  2. It displays at the top of the browser window, and is what is written when someone bookmarks your site. If people bookmark your site, you want them to remember it was your site and not "untitled".

<html> and <head>

As I mentioned above, both of these tags are required because of the <title> tag. They define your document and provide a location for hidden information that improves your site's standings in search engines.

Meta Information

Meta information are data contained in the <head> of your HTML document to provide additional information about your Web page. You can include information like the author's name, the program that was used to create the page, the date the page should expire, and, perhaps most importantly, keywords and descriptions for search engines.

Meta tags are very important to get good ranking in search engines. But if you have time to write either a good, descriptive title or meta tags, write the title. The title of your document will go further for search engine placement than meta tags.

Learn More About Meta Tags

The Top of Your Document

The top of your HTML documents with all the above information, will look like this:

<html>
<head>
<title>Write a Descriptive Title Here</title>
<meta name="description" content="a short description of the content of the Web site using keywords found in the title and your meta keywords">
<meta name="keywords" content="keywords that describe your site; use the same ones in your title and description">
</head>

Previous Features

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. Beginning HTML Tutorials
  6. What is the HEAD Tag for - The Top of Your Pages - What is in the Head of Your Web Pages

©2008 About.com, a part of The New York Times Company.

All rights reserved.