This element supplies meta-information about the current document. It can be
used to store extra information inside the document. For example, when you use
Netscape Navigator Gold to create an html page the program will insert a META
element with the name of the program as its generator.
Most META elements come in name/value pairs, one attribute describing the item
that is being defined, and the other containing the value of this item.
The other use of the META element is for simulating HTTP response headers in
HTML, using the HTTP-EQUIV attribute.
DTD
<!ELEMENT META - O EMPTY -- generic metainformation -->
<!ATTLIST META
%i18n; -- lang, dir, for use with content --
http-equiv NAME #IMPLIED -- HTTP response header name --
name NAME #IMPLIED -- metainformation name --
content CDATA #REQUIRED -- associated information --
scheme CDATA #IMPLIED -- select form of content --
>
from the
HTML 4.0 DTD,
"Copyright ©
W3C,
(MIT,
INRIA,
Keio).
All Rights Reserved."
Attributes
CONTENT
The value of the item of the meta-data that is being described. HTML 4.0
doesn't specify which are legal values.
HTTP-EQUIV
This is used to supply information that a HTTP-server can use to generate extra
HTTP headers, from the HTML data. Allowed values are :
Value |
Description |
Content-Type |
This allows MIME charset information to be contained in the HTML document:
<META http-equiv="Content-Type" content="text/html;
charset=ISO-2022-JP">
|
Expires |
This sets the expiration date & time for the current document.You can
use this value to keep your page from being cached if you set the expiration
date to a date in the past.
The format of how to specify a time is described in RFC850, in GMT.
|
Refresh |
This tells the client it must refresh the page after a number of seconds.
The number of seconds and the URL of the new page must be present in the
CONTENT attribute :
<META http-equiv="Refresh" content="10;
url=New-page.html">
Important note: make sure the URL you give is fully qualified (e.g.
http://whatever/whatever). That is, don't use a relative URL.
The interval can be 0 seconds. This will cause the browser to load the data
from the supplied URL as soon as it can. This makes it possible to use it as
an automatic redirection.
|
Set-Cookie |
This sets the name/value pair of a cookie.
If you supply an expiration date this cookie will be saved permanently on the
client computer.
|
See the HTTP specification for other headers you can simulate with the META
element.
NAME
Description of the item that is being described as meta-data. HTML 4.0 doesn't
specify which values are correct, but current used values are :
- Author
- The name of the author who wrote the document.
- Description
- A short description of the document.
- Keywords
- Several search sites use the values you supply here as keywords
in their index database. When you use the keywords that best describe the
subject of your page, this will make your page show up when a user
searches with these sites.
- Generator
- The name, or identification, of the program that created the document.
Several search engines such as
AltaVista
use the content for name="description" and
name="keywords" as references to a site.
SCHEME
This attribute sets the format used for the meta data that is being defined.
The format of the value for this attribute depends on what type of data is
supplied with this attribute.
Examples
 |
Here's a way to include your name in every page you create :<BR>
<META name="Author" content="Rob Schlüter">
|
|
 |
Here's a way to include your name in every page you create :
<META name="Author" content="Rob Schlüter">
|
|  |
<A href="META1.html">Visit this page</A>, which includes an automatic refresh.
It will switch automatically between two pages every 5 seconds.
|
|
 |
Visit this page, which includes an automatic refresh.
It will switch automatically between two pages every 5 seconds.
|
|  |
Set the expiration date for a page
<META http-equiv="Expires" content="Tue, 01 Dec 1990 06:30:00 GMT">
|
|
 |
Set the expiration date for a page
<META http-equiv="Expires" content="Tue, 01 Dec 1990 06:30:00 GMT">
|
|