English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML meta http-equiv attribute

http-equiv attribute provides information about the content attribute/value provides HTTP headers, http-equiv attribute can be used to simulate HTTP response headers.

 HTML <meta> tag

online example

every interval1refresh the web page every minute:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<meta> http-equiv attribute - Basic Tutorial Website(oldtoolbag.com)</title>
<meta http-equiv="refresh" content="60">
</head>
<body>
<h1>My Website</h1>
<p>Some text.../p>
</body>
</html>
test to see ‹/›

browser compatibility

IEFirefoxOperaChromeSafari

all major browsers support http-equiv attribute.

definition and usage

http-equiv attribute is content information about the attribute/value provides HTTP headers.

http-equiv attribute can be used to simulate HTTP response headers.

HTML 4.01 with HTML5differences

using http-equiv is no longer the only way to specify the character set of an HTML document:

  • HTML 4.01: <meta http-equiv="content-type" content="text/html; charset=UTF-8">

  • HTML5: <meta charset="UTF-8">

syntax

      <meta http-equiv="content-type|default-style|refresh">

attribute value

valuedescription
content-typeSpecify the character encoding of the document.

Example:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

default-styleSpecify the predefined stylesheet to be used.

Example:

<meta http-equiv="default-style" content="the document's preferred stylesheet">

Note:The value of the content attribute above must match the value of the title attribute of a link element in the same document, or it must match the value of the title attribute of a style element in the same document.

refreshDefine the time interval for automatic page refresh of the document, in seconds.

Example:

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

Note: The value "refresh" should be used with caution, as it may cause the page to be out of user control.W3C's Web Content Accessibility Guidelines Using "refresh" in it will lead to failure.

 HTML <meta> tag