HTML Meta Tages can be used to specify additional metadata about a
document, such as author, publication date, expiration
date, page description, keywords, or other information
not provided through the other header elements and
attributes. Because of their generic nature, meta
elements specify associative key-value pairs.
Meta elements can specify HTTP headers which should be
sent before the actual content when the HTML page is
served from Web server to client
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
You can add metadata to your web pages by placing <meta>
tags between the <head>
and </head>
tags. The can include the following attributes:
Attribute | Description |
---|---|
Name | Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc. |
content | Specifies the property's value. |
scheme | Specifies a scheme to use to interpret the property's value (as declared in the content attribute). |
http-equiv | Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie. |
This meta element defines a description of your page:
<meta name="description" content="Web Tutorials on HTML, CSS">
This meta element defines keywords for your page:
<meta name="keywords" content="HTML,DHTML,CSS,XML,XHTML,JavaScript" />
The date and time after which the document should be considered expired:
Web robots may delete expired documents from a search engine, or schedule a revisit.
Dates must be given in RFC850 format, in GMT. E.g. (META tag):
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT" />
The HTTP content type may be extended to give the character set.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP" />
Specifies the default scripting language in a document:
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript" />
Specifies the default style sheet language for a document:
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css" />
Declare the natural language of the document:
<META HTTP-EQUIV="Content-Language" CONTENT="en-GB" />
Specifies a delay in seconds before the browser automatically reloads the document:
<META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html"/>
Refresh the page every 5 seconds:
<meta http-equiv="refresh" content="5" />
Specifies the named window of the current page; can be used to stop a page appearing in a frame with many (not all) browsers:
<META HTTP-EQUIV="Window-target" CONTENT="_top" />
Controls Web robots on a per-page basis:
<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW" />