The META tag: Introduction

The usages of the META tag are poorly defined in the HTML specifications. The META tag is used primarily for two purposes today:

  1. It automatically moves users from one page to another (as seen on splash pages or forwarding-address pages) using its auto-refresh/client-pull capabilities; and
  2. It helps robotic search engines (such as AltaVista and Lycos) better categorize your HTML pages.

I'll talk about each of these topics, in depth, in the following sections.

The META tag requires two attributes: NAME and CONTENT. NAME identifies the type or variety of META tag in question; CONTENT sets the necessary information for that version of the META tag. The NAME attribute, in some cases, is interchangeable with the HTTP-EQUIV attribute; in other words, either NAME or HTTP-EQUIV will be used as the identifier attribute for the META tag, depending on the purpose of that particular META tag; the second attribute will always be CONTENT.

The META tag, like the IMG and BR tags, must close within its opening tag using the space-close-slash before the closing bracket syntax we've talked about before. The META tag always goes within the HEAD of an HTML page; it is NEVER placed in the BODY. You may place as many different META tags in the HEAD as you like.

Example (abbreviated):

<meta name="keywords" content="candy,cookie,cake,pie" />

Example (in context):

<html>
<head>
<title>Example META tags</title>
<meta name="keywords" content="candy,cookie,cake,pie" />
<meta name="description" content="I have a big sweet tooth." />
</head>
<body>
<p>Some content...</p>
</body>
</html>

The META tag, in brief, allows the programmer to attach extra non-HTML information to an HTML document. Outside vendors (such as robotic search engines) may define variations of the META tag which will assist them in indexing pages, or ANY other purpose. It is unlikely that too many more variations of the META tag will be introduced into common usage in the future, as XML and its family of languages (in addition to JavaScript and other scripting languages) encompasses the META tag's purpose.

Main Menu