Skip to: content, navigation

by Ian Lloyd

http-equiv (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Depr. Version
No HTML 2
http-equiv="http response header"

Example

The http-equiv defining the character set for the document:

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

Description

There are many settings that you can apply to a web server in the form of HTTP response headers - information that is sent back with the response to any request made for a resource on that server. However, not everyone has direct access to their web site’s server configuration options and in this instance you may use the meta element to simulate an HTTP response header. For example, the character encoding may be set at the server, but many web authoring packages include this as a meta element just in case this important information is not sent by the server.

Typical uses for the http-equiv attribute include managing cache control, page refreshes and page content safety ratings.

If the http-equiv attribute is used in the meta element, the name attribute should not be used.

Note that supplying an HTTP equivalent in a meta element is only effective if the server doesn't send the corresponding real header; you cannot override an HTTP header with a meta element. So using this attribute is only of any use when the server doesn't send that particular header or when there is no server involved, such as when viewing a document from the local file system.

Value

The value varies depending on usage. It may contain any of the following:

  • "Allow"
  • "Content-Encoding"
  • "Content-Length"
  • "Content-Type"
  • "Date"
  • "Expires"
  • "Last-Modified"
  • "Location"
  • "Refresh"
  • "Set-Cookie"
  • "WWW-Authenticate"

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Because it is so open what you can do with meta information, support is stated as ‘full’ (all browsers expose the meta information via the Document Object Model).

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters