<Related pages> | ||||
| ||||
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.
<!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."
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"
and
name="keywords"
as references to a site.
Here's a way to include your name in every page you create :<BR>
|
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.
|
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
|
Set the expiration date for a page <META http-equiv="Expires" content="Tue, 01 Dec 1990 06:30:00 GMT"> |