Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<meta>

<meta
charset=charset
content=description
dir=ltr|rtr
http-equiv=response
name=description
scheme=text
title=text
url=url
</meta>

Provides information about an HTML page to browsers, search engines, and other applications. You must only use the <meta> tag inside the <head> tag of the HTML.

Here are some common uses:

For example to reload a page every two seconds, enter:

<meta http-equiv="refresh" content="2">

You set the http-equiv attribute to REFRESH to gives the instruction to reload. The content attribute specifies the time in seconds that the page refreshes. You can specify any URL in the tag. If you do not specify a URL, the browser reloads the current page. This is referred to as Client Pull.

If the page contains:

<meta http-equiv="Expires"
content="Tue, 04 Dec 1996 21:29:02 GMT">
<meta http-equiv="Keywords" 
content="HTML, Reference">
<meta http-equiv="Reply-to" 
content="a.gilliver@lineone.net">
<meta http-equiv="Keywords" 
content="HTML Reference Guide">

then…

The server would include the following header fields as part of the HTTP response to a GET or HEAD request for that page:

  • Expires: Tue, 04 Dec 1996 21:29:02 GMT
  • Keywords: HTML, Reference
  • Reply-to: a.gilliver@lineone.net

The following example shows the correct usage for describing a character set. For more information, see Character sets.

<meta http-equiv="content-type" 
content="text/html; charset=windows-1251">
<html>
<head>
<meta http-equiv="refresh" content="2">
<title>Reload page</title>
</head>
<body>
<p>This page will be reloaded every two seconds.</p>
</body>
</html>


<html>
<head>
<meta http-equiv="refresh" content="5; 
url=http://www.sample.com/next.htm"> 
<title>Load next page</title>
</head>
<body>
<p>After five seconds have elapsed, the page 
"http://www.sample.com/next.htm" will be loaded.</p>
</body>
</html>

Attributes

charset=charset

The character set encoding. An example is ISO-8859-1 (often called Latin-1). This character set covers the most common characters in western European languages.

content=description

Defines the meta-information content to be associated with the name or http-equiv attributes. Can be used with the url attribute and a date and time specification to reload a page at a specified interval. It can also contain the name of the author, the program used to generate the page, a description of the page or a list of keywords.

dir=ltr|rtr

Specifies the direction of text. This can be left-to-right (ltr) or right-to-left (rtl). For example, English characters are presented left-to-right, Hebrew characters are presented right-to-left.

http-equiv=response

Binds the tag to an HTTP response header. This information is then used based on the application reading the header. You use this attribute with the contents attribute to tell a page to refresh, specify that a page has expired, specify the ratings label for the site and define the character set, style sheet or script language use for the page.

name=description

A description of the page.

scheme=text

Gives the format of the property value. For example, a date property may require scheme="Month-Day-Year" to differentiate the date from other formats such as scheme="Day-Month-Year".

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).

url=url

Indicates the page's URL.