There are two types of META tags, HTTP-EQUIV and tags
Â Â Â Â Â Â with a NAME attribute. HTTP-EQUIV tags are similar to HTTP headers. The
Â Â Â Â Â Â HTTP header is the information that is transmitted after a request is
Â Â Â Â Â Â made for your web page. It contains information which is useful to the
Â Â Â Â Â Â web browser for
Â Â Â Â Â Â how to display your page.
Â Â Â Â Â Â
META tags with a NAME attribute are tags that do not have corresponding header information. These tags were originally designed for large sites to easily catalogue their pages but have been used lately by search engines to help extrapolate what is on your web page.
The format of a META tag is simple, two examples are:
<META NAME="description" CONTENT="A tutorial covering the basic and advanced uses of META tags.">
<META HTTP-EQUIV="Refresh" CONTENT="0">
The < followed by "META" signals the browser that this is a META tag, the next word is what indicates which type of META tag it is, a NAME tag or an HTTP-EQUIV tag. Next, the Content is what the browser should do with the tag. In the first example, we are setting the description of the page to read "A tutorial covering the basic and advanced uses of META tags." Though we won't see this on the web page when we load it, some search engines use this to provide a description in search results listings.
In the second example, we are using HTTP-EQUIV to set a refresh rate. Don't worry too much about what those tags are doing right now, we will explain that in a second, just get familiar with how the tag is structured.Â
META tags should be placed inside the <HEAD> </HEAD> Popular uses for META include:
- <META NAME="generator" CONTENT="Some program">
- This indicates the program used to generate this document. It is often
the name of the HTML editor used.
- <META NAME="author" CONTENT="Name">
- This indicates the name of the author.
- <META NAME="keywords" CONTENT="keyword keyword keyword">
- Provides keywords for search engines such as Infoseek or Alta Vista.
These are added to the keywords found in the document itself. If you
insert a keyword more than seven times here, the whole tag will be
- <META NAME="description" CONTENT="This is a site">
- Search engines which support the above tag will now display the
text you specify here, rather than the first few lines of text from
the actual document when the document shows up in a search result. You
have about 1,000 characters for your description, but not all these
will be used.
- <META HTTP-EQUIV="refresh" CONTENT="n; URL=http://foo.bar/">
- This is a so-called "meta refresh", which on certain browsers causes
the document mentioned in the URL to be loaded after n seconds.
This can be used for slide shows or for often-changing information, but
has some drawbacks. In particular, if you use a value of zero seconds,
the user can no longer go "Back" with his back button. He will be
transferred to the specified URL, and when he presses "back" there,
he will go back to the document with the refresh, which immediately
redirects him to the document he tried to get away from.
- <META HTTP-EQUIV="expires" CONTENT="Tue, 20 Aug 1996 14:25:27 GMT">
- This indicates that the document containing this META tag will
expire at this date. If the document is requested after this date,
the browser should load a new copy from the server, instead of using
the copy in its cache.