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.

 Balise <meta> HTML

online example

every interval1refresh the web page every minute:

!DOCTYPE html
<html>
<head>
<title>HTML:<meta> http-equiv attribute - Basic Tutorial Network(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-typeDéfinir l'encodage des caractères du document.

Exemple :

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

default-styleDéfinir la feuille de style prédéfinie à utiliser.

Exemple :

<meta http-equiv="default-style" content="the document's Feuille de style préférée">

Remarque :La valeur de l'attribut content ci-dessus doit correspondre à la valeur de l'attribut title d'un élément link du même document, ou doit correspondre à la valeur de l'attribut title d'un élément style du même document.

refreshDéfinir l'intervalle de temps de rafraîchissement automatique du document, en secondes.

Exemple :

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

Remarque : la valeur "refresh" doit être utilisée avec précaution, car elle peut rendre la page hors du contrôle de l'utilisateur. DansW3C's Guide d'accessibilité du contenu Web l'utilisation de "refresh" peut entraîner un échec.

 Balise <meta> HTML