The void HTML <meta />
element, or metadata, informs the browser about some aspect of how a page should be handled. It's the catch-all among elements that go within the head, taking all sorts of different values which were not alotted their own tags. It represents any metadata information which cannot be represented using one of the another meta-related elements (<base />
, <link />
, <script>
, <style>
, or <title>
).
Attributes
Attribute | Value | Description |
---|---|---|
charset |
name | This attribute declares the character set used of the page. It can be locally overriden using the lang attribute on any element. This attribute is a literal string and must be one of the preferred MIME name for a character set as defined by the IANA. (HTML5)
|
content |
value | This attribute gives the value associated with the http-equiv or name attribute, depending on the context.
|
http-equiv |
content value | This enumerated attribute defines the pragma that can alter servers and user-agents behavior. The value of the pragma is defined using the content and can be one of the following:* content-language - This pragma defines the default language of the page. Obsolete*content-type - This attribute defines the MIME type of the document, eventually followed by its character set. It follows the same syntax as the HTTP content-type entity-header field, but as it is inside an HTML element, most values are not possible. Therefore the valid syntax for its content is the literal string 'text/html' eventually followed by a character set with the following syntax: '; charset=IANAcharset' where IANAcharset is the preferred MIME name for a character set as defined by the IANA. Obsolete
|
default-style |
value | This pragma specifies the preferred stylesheet to be used on the page. The content attribute must contains the id of a <link /> element whose href attribute links to a CSS stylesheet, or the id of a <style> element which contains a CSS stylesheet.
|
refresh |
value | This pragma specifies:
|
name |
name | This attribute defines the name of a document-level metadata. It should not be set if the attributes http-equiv or charset is also set. This document-level metadata name is associated with a value, contained by the content attribute. The possible values for the name element are, with their associated value stored via the content attribute:
|
HTML example:
<meta http-equiv="Refresh" content="5; URL=http://www.foo.com/foo.html" />
External links
- The meta element in HTML5
- The META element in HTML 4.01
- A Dictionary of HTML META Tags (Don't use frames, kids!) This is a good synopsis of the older standard, and the new one as well for the most part.