Latest web development tutorials

atributo meta http-equiv HTML

HTML etiquetas meta Manual de Referencia etiqueta <meta> HTML

Ejemplos

Cada 30 segundos para actualizar el documento:

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

Trate »

Soporte para el navegador

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Todos los principales navegadores soportan el atributo http-equiv.


Definición y Uso

atributo http-equiv proporciona contenido de la cabecera HTTP / valor de la propiedad.

atributo http-equiv puede ser utilizado para simular un encabezado de respuesta HTTP.


Diferencias entre HTML 4.01 y HTML5

Http-equiv única forma de utilizar el juego de caracteres no está especificado en un documento HTML:

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

gramática

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

propiedad Valor

描述
content-type 规定文档的字符编码。

实例:

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

default-style 规定要使用的预定义的样式表。

实例:

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

注释:上面 content 属性的值必须匹配同一文档中的一个 link 元素上的 title 属性的值,或者必须匹配同一文档中的一个 style 元素上的 title 属性的值。

refresh 定义文档自动刷新的时间间隔。

实例:

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

注释:值 "refresh" 应该慎重使用,因为它会使得页面不受用户控制。在 W3C's Web 内容可访问性指南 中使用 "refresh" 会到导致失败。



HTML etiquetas meta Manual de Referencia etiqueta <meta> HTML