http-equiv (HTML attribute)
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
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | Full |
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.

