HTML <meta> Tag

<!DOCTYPE html>
<html>
<head>
<title>Meta Refresh Example</title>
<meta http-equiv="refresh" content="5;url=/html-tags/meta_refresh_example.cfm">
</head>
<body>
<p>Watch me redirect to another page in 5 seconds...</p>
</body>
</html>

The above example demonstrates usage of the <meta> element.

The <meta> element represents metadata in an HTML document. More specifically, metadata that cannot be expressed using the <title>, <base>, <link>, <style>, and <script> elements.

Metadata can include document decription, keywords, author etc. It can also be used to refresh the page or set cookies.

If you use the <meta> element, it must contain one (but no more) of the name, http-equiv, or charset attributes.

If either name or http-equiv is specified, then the content attribute must also be specified. Otherwise, it must be omitted.

The content attribute gives the value of the document metadata or pragma directive when the element is used for those purposes. The allowed values depend on the exact context, as described in subsequent sections of this specification.

Values for the name Attribute

Standard values for the name attribute include the following:

application-name
Must be a short free-form string giving the name of the Web application that the page represents. If the page is not a Web application, the application-name metadata name must not be used. There must not be more than one meta element with its name attribute set to the value application-name per document. Browsers/user agents may use the application name in UI in preference to the page's title, since the title might include status messages and the like relevant to the status of the page at a particular moment in time instead of just being the name of the application.
author
Free-form string giving the name of one of the page's authors.
description
Free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine. There must not be more than one meta element with its name attribute set to the value description per document.
generator
Free-form string that identifies one of the software packages used to generate the document. This value must not be used on hand-authored pages.
keywords
The value must be a set of comma-separated tokens, each of which is a keyword relevant to the page. For example, keywords for the current page could include "html5 meta tag, element, metadata, meta data, keyword, keywords, description, generator, application-name, author"

Values for the http-equiv Attribute

Possible values for the http-equiv include:

  • content-language
  • content-type
  • default-style
  • refresh