The META
element is used within the <HEAD>
element to embed any useful information not defined by other HTML elements. Such information can be extracted by servers/clients for use in identifying, indexing and cataloguing documents.
In addition, HTTP servers can read the content of the document head to generate response headers corresponding to any elements defining a value for the attribute HTTP-EQUIV
. This provides document authors a mechanism (not necessarily the preferred one) for identifying information that should be included in the response headers for an HTTP request and forms the basis of the Client Pull mechanism.
Attributes of the <META>
element :
HTTP-EQUIV
This attribute specifies the HTTP response header that the information pertains to. If the semantics of the HTTP response header named by this attribute is known, then the contents can be processed based on a well-defined syntactic mapping whether or not the DTD includes anything about it. HTTP header names are not case sensitive. If not present, the NAME
attribute should be used to identify this meta-information and it should not be used within an HTTP response header.
NAME
Meta-information name. If the NAME
attribute is not present, then name can be assumed equal to the value HTTP-EQUIV
.
CONTENT
The meta-information content to be associated with the given name and/or HTTP response header.
Typically, the <META>
element would be used to introduce Client Pull into HTML documents, or to specify keywords that may be used by search engines to determine a documents relevance to the current search (although some are stopping using this method).
Microsoft's Internet Explorer now supports the use of HTML ratings, to restrict access to pages that whoever controls the browser deems unacceptable. This uses the W3C's PICS (Platform for Internet Content Selection - http://www.w3.org/PICS/) format of content labelling and currently supports the use of labels provided by the RSAC (Recreational Software Advisory Council - http://www.rsac.org/) under their RSACi labelling vocabulary. NOTE : The PICS format devised by the W3C, defines the format for content labelling, not the actual definitions of the labels - this is up to individual organisations who (like the RSAC, in RSACi) provide ratings services.
Author labelling of content is a step towards responsible self-censorship in the wake of recent government intervention and provides responsible content authors with a way of labelling their web sites, so that users who do not wish to view their content, can not stumble across it by accident, as they can control the browser to block sites who provide labels for content that the user may deem offensive.
PICS rating labels are included in the document with <META>
elements within the <HEAD>
elements, allowing the browser to determine whether the content is 'safe' for the user, based on their ratings settings, before any of the main page content has been retrieved. It should be noted that the user should not write their own ratings within the <META>
element, but should submit pages to ratings organisations for independent rating. With the RSAC, this involves filling out a series of short forms, detailing whether your site contains any degree of offensive language, violence, sex or nudity. They then provide the specific <META>
element for the page, site directory, or whole site. An example of a RSAC PICS rating (for the HTMLib web site main page) is :
<META http-equiv="PICS-Label" content='(PICS-1.0 "http://www.rsac.org/ratingsv01.html" l gen false comment "RSACi North America Server" by "cmlehunt@swan.ac.uk" for "http://subnet.virtual-pc.com/~le387818/index.html" on "1996.04.04T08:15-0500" exp "1997.01.01T08:15-0500" r (n 0 s 0 v 0 l 0))'>
From the last line of the ratings code, you can see r (n 0 s 0 v 0 l 0)
which means that I rated the HTMLib web site as containing no nudity (n), sex (s), violence (v), or bad language (l).
Also, Internet Explorer supports a mechanism known as pragma no-cache, using the <META>
element to prevent pages from being cached by the browser. Using this method, you can prevent the page that contains the HTML from being cached by the browser, ensuring that the most recent version of the page is always seen by the user. This is especially useful for pages that may be dynamically created (for instance, search query results, or database searches). To take advantage of this mechanism, use the EXPIRES
keyword, together with a date that has already past. For example :
<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
In this case, the browser will be made to believe that the document expired on the 6th January 1990 and so, will not cache the page. For more information, see the HTTP 1.1 specification details at http://www.w3.org/pub/WWW/Protocols/HTTP/1.1/spec.html.