HTML and meta-gt; http-equiv properties

HTML meta http-equiv property HTML .lt;meta.gt; tags

The http-equiv property, which is the equivalent of http://meta-gt; labels the equivalent of http's header file, conveys useful information to the browser, and the value of the variable used by the property is specified in the content property, see the following example:

Refresh the document every 30 seconds:

<head>
<meta http-equiv="refresh" content="30">
</head>

Try it out . . .

Browser support

HTML meta http-equiv property HTML meta http-equiv property HTML meta http-equiv property HTML meta http-equiv property HTML meta http-equiv property

The http-equiv property is supported by all major browsers.


Definitions and usages

The http-equiv property provides the http header of the content property's information/value.

The http-equiv property can be used to simulate an HTTP response header.


The difference between HTML 4.01 and HTML5

Using http-equiv is no longer the only way to specify character sets for HTML documents:

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

Grammar

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

The property value

value describe
content-type Specify the character encoding of the document.

Example:

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

default-style Provisions to predefined style sheets to use.

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 property on one of the LINK elements in the same document, or must match the value of the Title property on one style element in the same document.

refresh Define the time interval of the document automatic refresh.

Example:

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

Note: Value "Refresh" should be careful because it will make the page are not controlled by user.exist W3C's Web Content Accessibility Guide Use "Refresh" to fail to fail.



HTML meta http-equiv property HTML .lt;meta.gt; tags