http-equiv attribute | httpEquiv property

Expand
7 out of 14 rated this helpful - Rate this topic

http-equiv attribute | httpEquiv property

[This documentation is preliminary and is subject to change.]

Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.

HTML 4.01 Specification, Section 7.4.4

Syntax

HTML<element http-equiv="p" ... >
JavaScript

p = object.httpEquiv

Property values

Type: String

the information in the response header. See HTTP Response Headers for a list of possible values.

Standards information

Remarks

If the property is omitted, the name property should be used to identify the meta-information. The httpEquiv property is not case-sensitive.

Developers using the httpEquiv and content attributes to refresh documents from alternate URLs should treat the value of content as untrusted data. For more information, please see Security Considerations: Dynamic HTML.

As of Windows Internet Explorer 8, the httpEquiv attribute also supports a value of x-ua-compatible, which allows developers to specify the document compatibility mode that Windows Internet Explorer should use to display a webpage. To do this, set the content attribute to a String value containing a comma-delimited list of one or more of the following values.

ValueDescription
IE=9The webpage is displayed in IE9 Standards mode.
IE=8The webpage is displayed in IE8 Standards mode.
IE=7The webpage is displayed in IE7 Standards mode.
IE=5The webpage is displayed in IE5 (Quirks) mode.
IE=EmulateIE9If the webpage specifies a standards-based doctype directive, the page is displayed in IE9 mode; otherwise, it is displayed in IE5 mode.
IE=EmulateIE8If the webpage specifies a standards-based doctype directive, the page is displayed in IE8 mode; otherwise, it is displayed in IE5 mode.
IE=EmulateIE7If the webpage specifies a standards-based doctype directive, the page is displayed in IE7 mode; otherwise, it is displayed in IE5 mode.
IE=EdgeThe webpage is displayed in the highest mode available to the version of Internet Explorer used to view the page. This option is generally intended for testing purposes.

 

When the content attribute specifies multiple document modes, Internet Explorer displays the page in the highest mode supported by the browser. For more information, see Defining Document Compatibility.

Examples

This example causes the browser to reload the document every two seconds.


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

This example sets the character set for the document.


<meta http-equiv="Content-Type"
      content="text/html; charset=utf-8">

This example disables theme support for the document.


<meta http-equiv="msthemecompatible" content="no">

This example tells Internet Explorer to display a webpage in IE9 mode, if possible.


<meta http-equiv="X-UA-Compatible" content="IE=9">

See also

Reference
content
meta
Conceptual
Defining Document Compatibility

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
HTML is not XHTML
@Berggreen  It's not necessary to close empty tags in HTML. You are thinking of XHTML.
5/3/2012
Tags
@Berggreen, seeing how they can't even manage to do the simple things correctly, I'm not surprised that all versions of IE, to date, have been trash.
9/22/2011
HTML tags should be lower-cased

It's not good to show examples with uppercase HTML tags.

The above mentioned META tags should be written as:

<meta http-equiv="........" content=".........." />

Secondly, to be a "nice tag" it should also be closed at the end with an / ... otherwise there should be a </meta> afterwards.

5/10/2009