6.8. Supporting Document Automation
6.8.1. The <meta> Header Element
But no. There's always someone with special needs. They want to be able to give even more information about their precious document, information that might be used by browsers, readers of the source, or by document-indexing tools. The <meta> tag is for you who need to go beyond the beyond.
The <meta> tag belongs in the document header and has no content. Instead, attributes of the tag define name/value pairs that associate the document. In certain cases, these values are used by the web server serving the document to further define the document content type to the browser.
184.108.40.206. The name attribute
The name attribute supplies the name of the name/value pair defined by the <meta> tag. Neither the HTML nor the XHTML standard specify any predefined <meta> names. In general, you are free to use any name that makes sense to you and other readers of your source document.
One common name used is keywords, which defines a set of keywords for the document. When encountered by any of the popular search engines on the Web, these keywords will be used to categorize the document. If you want your documents to be indexed by a search engine, consider putting this kind of tag in the <head> of each document:
<meta name="keywords" content="kumquats, cooking, peeling, eating">
If the name attribute is not provided, the name of the name/value pair is taken from the http-equiv attribute.
220.127.116.11. The content attribute
The content attribute provides the value of the name/value pair. It can be any valid string, enclosed in quotes, if it contains spaces. It should always be specified in conjunction with either a name or http-equiv attribute.
As an example, you might place the author's name in a document with:
<meta name="Authors" content="Chuck Musciano & Bill Kennedy">
18.104.22.168. The http-equiv attribute
The http-equiv attribute supplies a name for the name/value pair and instructs the server to include the name/value pair in the MIME document header that is passed to the browser before sending the actual document.
When a server sends a document to a browser, it first sends a number of name/value pairs. While some servers might send a number of these pairs, all servers send at least one:
This tells the browser to expect to receive an HTML document.
When you use the <meta> tag with the http-equiv attribute, the server will add your name/value pairs to the content header it sends to the browser. For example, adding:
<meta http-equiv="charset" content="iso-8859-1"> <meta http-equiv="expires" content="31 Dec 99">
causes the header sent to the browser to contain:
content-type: text/html charset: iso-8859-1 expires: 31 Dec 99
Of course, adding these additional header fields makes sense only if your browser accepts the fields and uses them in some appropriate manner.
22.214.171.124. The charset attribute
Internet Explorer provides explicit support for a charset attribute in the <meta> tag. Set the value of the attribute to the name of the character set to be used for the document. This is not the recommended way to define a document's character set. Rather, we recommend always using the http-equiv and content attributes to define the character set.
126.96.36.199. The scheme attribute
This attribute specifies the scheme to be used to interpret the property's value. This scheme should be defined within the profile specified by the profile attribute of the <head> tag. Section 3.7.1, "The <head> Tag"
6.8.2. The <nextid> Header Element
The idea behind the <nextid> tag is to provide some way of automatically indexing fragment identifiers.
188.8.131.52. The n attribute
<html> <head> <nextid n=DOC54> </head> ...
Copyright © 2002 O'Reilly & Associates. All rights reserved.