META tag information
An HTML document consists of two parts. The body of the document contains the content in HTML markup. An often-overlooked part of the HTML document is the "head", which contains metadata ( information about the document). Below is a list of the most useful HTML elements that can be used in the head part of an HTML document.
The TITLE element is probably the most well-known. It is used to indicate the title of the current document, which is usually shown in the top of the browser window. It may not contain tags, but may contain HTML entities.
The BASE element indicates which URL the browser should assume the document is at. Using BASE is only necessary when the URL used to retrieve the document is not the correct one. For example, a document may be mirrored on another site, or a document may be accessible via more than one URL. In such a case, this tag can be used to indicate the correct URL.
The value for the HREF attribute should be an absolute URL. Relative URLs will produce undefined results.
The ISINDEX element is an old-fashioned way to indicate a server has the capability to search the current document. Browsers which support this can now let the user specify one or more keywords, which are then sent to the server. The server can then perform the search.
Today it is recommended to use an HTML input form instead.
Note that the server must have the capability to perform searches. Simply adding ISINDEX in the document will not turn your server into a search engine.
The LINK element is used to indicate relationships between documents. There are two possible relationships. REL indicates how the current document is related to the document specified in the URL. REV indicates a reverse relationship. In other words, the other document has the indicated relationship with this one.
Some possible values:
- REV="made": Indicates the creator of the document. Usually the URL is a mailto: URL with the creator's e-mail address. Advanced browsers will now let the reader comment on the page with just one button or keystroke.
- REL="stylesheet": This indicates the location of the appropriate style sheet for the current document.
The following LINK tags allow advanced browsers to automatically generate a navigational buttonbar for the site. For each possible value, the URL can be either absolute or relative.
- REL="home": Indicates the location of the homepage, or starting page in this site.
- REL="toc": Indicates the location of the table of contents, or overview of this site.
- REL="index": Indicates the location of the index for this site. This doesn't have to be the same as the table of contents. The index could be alphabetical, for example.
- REL="glossary": Indicates the location of a glossary of terms for this site.
- REL="copyright": Indicates the location of a page with copyright information for information and such on this site.
- REL="up": Indicates the location of the document which is logically directly above the current document.
- REL="next": Indicates the location of the next document in a series, relative to the current document.
- REL="previous": Indicates the location of the previous document in a series, relative to the current document.
- REL="help": Indicates the location of a help file for this site. This can be useful if the site is complex, or if the current document may require eplanations to be used correctly (for example, a large fill-in form).
The META element is used to convey meta-information about the document, but can also be used to specify headers for the document. By using HTTP-EQUIV, a server should use the name indicated as a header, with the specified CONTENT as its value. For example, these elements could be used:
<META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT"> <META HTTP-EQUIV="Keywords" CONTENT="Nanotechnology, Biochemistry"> <META HTTP-EQUIV="Reply-to" CONTENT="email@example.com (Dave Raggett)">
The server should include the following response headers when the document is requested. Unfortunately this is not well-supported.
Expires: Tue, 04 Dec 1993 21:29:02 GMT Keywords: Nanotechnology, Biochemistry Reply-to: firstname.lastname@example.org (Dave Raggett)
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. Due to large amounts of abuse, these keywords are often ignored these days, or are only recognized if the keywords are also used in the actual content of the document.
- 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.