Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1035982 of <meta>

  • Revision slug: Web/HTML/Element/meta
  • Revision title: <meta>
  • Revision id: 1035982
  • Created:
  • Creator: Tigt
  • Is current revision? No
  • Comment the Yahoo directory is dead

Revision Content

{{HTMLRef}}

The HTML <meta> element represents any metadata information that cannot be represented by one of the other HTML meta-related elements ({{HTMLElement("base")}}, {{HTMLElement("link")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}} or {{HTMLElement("title")}}).

Depending on the attributes set, the kind of metadata can be one of the following:

  • If {{htmlattrxref("name", "meta")}} is set, it is document-level metadata, applying to the whole page.
  • If {{htmlattrxref("http-equiv", "meta")}} is set, it is a pragma directive, i.e. information normally given by the web server about how the web page should be served.
  • If {{htmlattrxref("charset", "meta")}} is set, it is a charset declaration, i.e. the charset used for the serialized form of the webpage.
  • If {{htmlattrxref("itemprop", "meta")}} is set, it is user-defined metadata, transparent for the user-agent as the semantics of the metadata is user-specific. {{experimental_inline}}
Content categories Metadata content. If the {{htmlattrxref("itemprop", "meta")}} attribute is present: flow content, phrasing content.
Permitted content None, it is an {{Glossary("empty element")}}.
Tag omission As it is a void element, the start tag must be present and the end tag must not be present
Permitted parent elements <meta charset>, <meta http-equiv>: a {{HTMLElement("head")}} element. If the {{htmlattrxref("http-equiv", "meta")}} is not an encoding declaration, it can also be inside a {{HTMLElement("noscript")}} element, itself inside a {{HTMLElement("head")}} element.
DOM interface {{domxref("HTMLMetaElement")}}

Attributes

This element includes the global attributes.

Note that the global {{htmlattrxref("name", "meta")}} has a specific semantic in the {{HTMLElement("meta")}} element and that the {{htmlattrxref("itemprop", "meta")}} must not be set when one of the {{htmlattrxref("name", "meta")}}, {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("charset", "meta")}} is already used.

{{htmlattrdef("charset")}}
This attribute declares the character encoding used of the page. It can be locally overridden using the lang attribute on any element. This attribute is a literal string and must be one of the preferred MIME names for a character encoding as defined by the IANA. Though the standard doesn't request a specific character encoding, it gives some recommendations:
  • Authors are encouraged to use UTF-8.
  • Authors should not use ASCII-incompatible encodings (i.e. those that don't map the 8-bit code points 0x20 to 0x7E to the Unicode 0x0020 to 0x007E code points) as these represent a security risk: browsers not supporting them may interpret benign content as HTML Elements. This is the case of at least the following charsets: JIS_C6226-1983, JIS_X0212-1990, HZ-GB-2312, JOHAB, the ISO-2022 family, and the EBCDIC family.
  • Authors must not use CESU-8, UTF-7, BOCU-1 and SCSU, also falling in that category and not intended to be used on the web. Cross-scripting attacks with some of these encodings have been documented.
  • Authors should not use UTF-32 because not all HTML5 encoding algorithms can distinguish it from UTF-16.
Notes:
  • The declared character set must match the one of the page. There is no valid reason to declare an inaccurate character set.
  • This {{HTMLElement("meta")}} element must be inside the {{HTMLElement("head")}} element and within the 512 first bytes of the page, as some browsers only look at these first bytes before choosing a character set for the page.
  • This {{HTMLElement("meta")}} element is only a part of the algorithm to determine the character set of a page that browsers apply. The HTTP Content-Type header and any BOM elements have precedence over this element.
  • It is good practice, and strongly recommended, to define the character set using this attribute. If no character set is defined for a page, several cross-scripting techniques may be able to harm the page user, such as the UTF-7 fallback cross-scripting technique. Always setting this meta will protect against these risks.
  • This {{HTMLElement("meta")}} element is a synonym for the pre-HTML5 <meta http-equiv="Content-Type" content="text/html; charset=IANAcharset"> where IANAcharset corresponds of the value of the equivalent {{htmlattrxref("charset", "meta")}} attribute. This syntax is still allowed, although obsolete and no longer recommended.
{{htmlattrdef("content")}}
This attribute gives the value associated with the {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("name", "meta")}} attribute, depending of the context.
{{htmlattrdef("http-equiv")}}
This enumerated attribute defines the pragma that can alter servers and user-agents behavior. The value of the pragma is defined using the {{htmlattrxref("content", "meta")}} and can be one of the following:
"content-language" {{obsolete_inline}}
This pragma defines the default language of the page.
Do not use this pragma, as it is obsolete. Use the global lang attribute on the {{HTMLElement("html")}} element instead.
"Content-Security-Policy"
This value allows web site administrators to define content policies for served resources. With a few exceptions, policies mostly involve specifiying server origins and script endpoints. This helps guard against cross-site scripting attacks.
"content-type" {{obsolete_inline}}
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.
Usage note:
  • Do not use this pragma as it is obsolete. Use the {{htmlattrxref("charset", "meta")}} attribute on the {{HTMLElement("meta")}} element instead.
  • As the {{HTMLElement("meta")}} may not be used to change the type of a document in an XHTML document, or in an HTML5 document following the XHTML syntax, never set MIME type to an XHTML MIME type that way. It would be incorrect.
  • Only an HTML document can use the content-type, so most of it is redundant: that's why it has been obsoleted and replaced by the {{htmlattrxref("charset", "meta")}} attribute.
"default-style"
This pragma specifies the preferred stylesheet to be used on the page. The {{htmlattrxref("content", "meta")}} attribute must contain the title of a {{HTMLElement("link")}} element whose {{htmlattrxref("href", "link")}} attribute links to a CSS stylesheet, or the title of a {{HTMLElement("style")}} element which contains a CSS stylesheet.
"refresh"
This pragma specifies:
  • the number of seconds until the page should be reloaded, if the {{htmlattrxref("content", "meta")}} attribute contains only a positive integer number;
  • the number of seconds until the page should be redirected to another, if the {{htmlattrxref("content", "meta")}} attribute contains a positive integer number followed by the string ';url=' and a valid URL.
"set-cookie" {{obsolete_inline}}
This pragma defines a cookie for the page. Its content must follows the syntax defines in the IETF HTTP Cookie Specification.
Note: Do not use this pragma as it is obsolete. Use the HTTP header set-cookie instead.
{{htmlattrdef("name")}}
This attribute defines the name of document-level metadata. It should not be set if one of the attributes {{htmlattrxref("itemprop", "meta")}}, {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("charset", "meta")}} is also set.
This document-level metadata name is associated with a value, contained by the {{htmlattrxref("content", "meta")}} attribute. The possible values for the name element are, with their associated value, stored via the {{htmlattrxref("content", "meta")}} attribute:
  • application-name, defining the name of the web application running in the webpage;
    Note:
    • Browsers may use this to identify the application. It is different from the {{HTMLElement("title")}} element, which usually consist of the application name but may also contain specific information like the document name or a status;
    • Simple webpages shouldn't define the application-name meta.
  • author, defining, in a free format, the name of the author of the document;
  • description, containing a short and accurate summary of the content of the page. Several browsers, among them Firefox and Opera, use this meta as the default description of the page when bookmarked;
  • generator, containing, in a free format, the identifier to the software that generated the page;
  • keywords, containing, as strings separated by commas, relevant words associated with the content of the page;
  • referrer {{experimental_inline}} controlling the content of the HTTP Referer HTTP header attached to any request sent from this document:
    Values for the content of <meta name="referrer">
    no-referrer Do not send a HTTP Referer header.
    origin Send the origin of the document.
    no-referrer-when-downgrade Send the origin as referrer to a-priori as-much-secure destination (https->https), but doesn't send a referrer to a less secure destination (https->http). This is the default behavior.
    origin-when-crossorigin Send a full URL (stripped from parameters) when performing a same-origin request, but only send the origin of the document for other cases.
    unsafe-URL Send a full URL (stripped from parameters) when perfoming a a same-origin or cross-origin request.

    Note: Some browsers support keywords always, default, and never for referrer. These values are deprecated.  

    Note: Dynamically inserting <meta name="referrer"> (by document.write or appendChild) create a non-determinism when it comes to sending referrers or not. Note also that when several conflicting policies are defined, the No-referrer policy is applied.

The attribute may also have a value taken from the extended list defined on WHATWG Wiki MetaExtensions page. Although none has been formally accepted yet, a few commonly used names are among the proposals:

  • creator, defining, in a free format, the name of the creator of the document. Note that it can be the name of the institution. If there are more than one, several {{HTMLElement("meta")}} elements should be used;
  • googlebot, which is a synonym of robots, but is only followed by Googlebot, the indexing crawler for Google;
  • publisher, defining, in a free format, the name of the publisher of the document. Note that it can be the name of the institution;
  • robots, defining the behavior that cooperative crawlers should have with the page. It is a comma-separated list of values taken in the following list:
    Values for the content of <meta name="robots">
    Value Description Used by
    index Allows the robot to index the page All
    noindex Prevents the robot from indexing the page All
    follow Allows the robot to follow the links on the page All
    nofollow Prevents the robot from following the links on the page All
    noodp Prevents the usage of the Open Directory Project description, if any, as the description of the page in the search engine results page

    Google, Yahoo, Bing

    noarchive Prevents the search engine from caching the content of the page Google, Yahoo
    nosnippet Prevents the display of any description of the page in the search engine results page Google
    noimageindex Prevents this page from appearing as the referring page of an indexed image Google
    nocache Synonym of noarchive Bing
    Notes:
    • Only cooperative robots will follow the rules defined by the robots name. Do not expect to keep e-mail harvesters at bay with this.
    • The robot still needs to access the page in order to read the meta value. If you want to keep them at bay, for example to prevent bandwidth consumption, use a robots.txt file instead (or in complement).
    • If you want to remove the page of an index, changing the meta to noindex will work, but only when the robot visit the page again. Be sure not to prevent such visits, via the robots.txt file for example. Some search engines have developers tools, allowing a quick removal of some page.
    • Some possible values are mutually exclusive, like using index and noindex, or follow and nofollow, at the same time. In these cases the behavior of the robot is undefined, and may vary from one to the other. So avoid these cases.
    • Some search engine crawler robots, like those of Google, Yahoo Search or Bing, support the same values on an HTTP directive, X-Robot-Tags: this allows them to use these pragma on non-HTML documents, like images.
  • slurp, which is a synonym of robots, but is only followed by Slurp, the indexing crawler for Yahoo Search;

Finally a few names are in common use, though not in progress of being standardized:

  • viewport, which gives hints about the size of the initial size of the {{glossary("viewport")}}. This pragma is used by several mobile devices only.
    Values for the content of <meta name="viewport">
    Value Possible values Description
    width a positive integer number or the literal device-width defines the width, in pixels, of the viewport
    height a positive integer number or the literal device-height defines the height, in pixels, of the viewport
    initial-scale a positive number between 0.0 and 10.0 defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size.
    maximum-scale a positive number between 0.0 and 10.0 defines the maximum value of the zoom; it must be greater or equal to the minimum-scale or the behavior is indeterminate.
    minimum-scale a positive number between 0.0 and 10.0 defines the minimum value of the zoom; it must be smaller or equal to the maximum-scale or the behavior is indeterminate.
    user-scalable a boolean value (yes or no) If set to no, the user is not able to zoom in the webpage. Default value is yes.
    Specification Status Comment
    {{SpecName('CSS3 Device', '#viewport-meta', '<meta name="viewport">')}} {{Spec2('CSS3 Device')}} Non-normatively describes the Viewport META element
    See also: {{cssxref("@viewport")}}
    Notes:
    • Though not standardized, this attribute is used by different mobile browsers like Safari Mobile, Firefox for Mobile or Opera Mobile.
    • The default values may change from one device, and browser, to another.
    • To learn about this pragma in Firefox for Mobile, see this article.
{{htmlattrdef("scheme")}} {{obsolete_inline}}
This attribute defines the scheme in which the metadata is described. A scheme is a context leading to the correct interpretations of the {{htmlattrxref("content", "meta")}} value, like a format.
Notes: Do not use this attribute as it is obsolete. There is no replacement for it as there was no real usage for it. Omit it altogether.

Examples

<!-- In HTML5 -->
<meta charset="utf-8">

<!-- Defining the charset in HTML4 --> 
<!-- Note: This is invalid in HTML5 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!-- Redirect page after 3 seconds -->
<meta http-equiv="refresh" content="3;url=https://www.mozilla.org/">

Specifications

Specification Status Comment
{{SpecName('Referrer Policy', '#referrer-policy-delivery-meta', '<meta name="referrer">')}} {{Spec2('Referrer Policy')}} Defines values and semantics of <meta name="referrer">.
{{SpecName('HTML WHATWG', 'semantics.html#the-meta-element', '<meta>')}} {{Spec2('HTML WHATWG')}} Added itemprop attribute
{{SpecName('HTML5 W3C', 'document-metadata.html#the-meta-element', '<meta>')}} {{Spec2('HTML5 W3C')}} Added charset attribute
{{SpecName('HTML4.01', 'struct/global.html#h-7.4.4.2', '<meta>')}} {{Spec2('HTML4.01')}}  

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
name="referrer" {{CompatChrome("17")}} {{CompatGeckoDesktop("36.0")}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Constrained to values listed under referrer (as specified in the spec.) {{CompatChrome("46.0")}}        
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
name="referrer" {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("36.0")}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
Constrained to values listed under referrer (as specified in the spec.) {{CompatNo}} {{CompatChrome("46.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatChrome("46.0")}}

[1] The referrer value wasn't taken into account when navigation was happening via the context menu or middle click until Firefox 39.

See also

  • The other elements containing metadata: {{HTMLElement("base")}}, {{HTMLElement("head")}}, {{HTMLElement("link")}}, {{HTMLElement("style")}},{{HTMLElement("title")}}.

Revision Source

<div>{{HTMLRef}}</div>

<p>The <strong>HTML <code>&lt;meta&gt;</code> element</strong><em> </em>represents any metadata information that cannot be represented by one of the other HTML meta-related elements ({{HTMLElement("base")}}, {{HTMLElement("link")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}} or {{HTMLElement("title")}}).</p>

<p>Depending on the attributes set, the kind of metadata can be one of the following:</p>

<ul>
 <li>If {{htmlattrxref("name", "meta")}} is set, it is&nbsp;<em>document-level</em> <em>metadata</em>, applying to the whole page.</li>
 <li>If {{htmlattrxref("http-equiv", "meta")}} is set, it is a&nbsp;<em>pragma directive</em>, i.e. information normally given by the web server about how the web page should be served.</li>
 <li>If {{htmlattrxref("charset", "meta")}} is set, it is a&nbsp;<em>charset declaration</em>, i.e. the charset used for the serialized form of the webpage.</li>
 <li>If {{htmlattrxref("itemprop", "meta")}} is set, it is <em>user-defined metadata</em>, transparent for the user-agent as the semantics of the metadata is user-specific. {{experimental_inline}}</li>
</ul>

<table class="properties">
 <tbody>
  <tr>
   <th><a href="/en-US/docs/Web/HTML/Content_categories">Content categories</a></th>
   <td>Metadata content. If the {{htmlattrxref("itemprop", "meta")}} attribute is present: <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">flow content</a>, <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">phrasing content</a>.</td>
  </tr>
  <tr>
   <th>Permitted content</th>
   <td>None, it is an {{Glossary("empty element")}}.</td>
  </tr>
  <tr>
   <th>Tag omission</th>
   <td>As it is a void element, the start tag must be present and the end tag must not be present</td>
  </tr>
  <tr>
   <th>Permitted parent elements</th>
   <td><code>&lt;meta charset&gt;</code>, <code>&lt;meta http-equiv&gt;</code>: a {{HTMLElement("head")}} element. If the {{htmlattrxref("http-equiv", "meta")}} is not an encoding declaration, it can also be inside a {{HTMLElement("noscript")}} element, itself inside a {{HTMLElement("head")}} element.</td>
  </tr>
  <tr>
   <th>DOM interface</th>
   <td>{{domxref("HTMLMetaElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Attributes">Attributes</h2>

<p>This element includes the&nbsp;<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes" title="HTML/Global attributes">global attributes</a>.</p>

<p>Note that the global {{htmlattrxref("name", "meta")}} has a specific semantic in the {{HTMLElement("meta")}} element and that the {{htmlattrxref("itemprop", "meta")}} must not be set when one of the {{htmlattrxref("name", "meta")}}, {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("charset", "meta")}} is already used.</p>

<dl>
 <dt>{{htmlattrdef("charset")}}</dt>
 <dd>This attribute declares the character encoding used of the page. It can be locally overridden using the <strong>lang</strong> attribute on any element. This attribute is a literal string and must be one of the <em>preferred MIME names</em> for a character encoding as <a class="external" href="https://www.iana.org/assignments/character-sets" title="https://www.iana.org/assignments/character-sets">defined by the IANA</a>. Though the standard doesn't request a specific character encoding, it gives some recommendations:
 <ul>
  <li>Authors are encouraged to use UTF-8.</li>
  <li>Authors should not use ASCII-incompatible encodings (i.e. those that don't map the 8-bit code points 0x20 to 0x7E to the Unicode 0x0020 to 0x007E code points) as these represent a security risk: browsers not supporting them may interpret benign content as HTML&nbsp;Elements. This is the case of at least the following charsets: JIS_C6226-1983, JIS_X0212-1990, HZ-GB-2312, JOHAB, the ISO-2022 family, and the EBCDIC family.</li>
  <li>Authors must not use CESU-8, UTF-7, BOCU-1 and SCSU, also falling in that category and not intended to be used on the web. Cross-scripting attacks with some of these encodings have been documented.</li>
  <li>Authors should not use UTF-32 because not all HTML5 encoding algorithms can distinguish it from UTF-16.</li>
 </ul>

 <div class="note"><strong>Notes:</strong>

 <ul>
  <li>The declared character set must match the one of the page. There is no valid reason to declare an inaccurate character set.</li>
  <li>This {{HTMLElement("meta")}} element must be inside the {{HTMLElement("head")}} element and <strong>within the 512 first bytes</strong> of the page, as some browsers only look at these first bytes before choosing a character set for the page.</li>
  <li>This {{HTMLElement("meta")}} element is only a part of the <a href="https://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#encoding-sniffing-algorithm" title="Algorithm charset page">algorithm to determine the character set</a> of a page that browsers apply. The HTTP&nbsp;Content-Type header and any BOM&nbsp;elements have precedence over this element.</li>
  <li>It is good practice, and strongly recommended, to define the character set using this attribute. If no character set is defined for a page, several cross-scripting techniques may be able to harm the page user, such as the <a class="external" href="https://code.google.com/p/doctype-mirror/wiki/ArticleUtf7" title="https://code.google.com/p/doctype/wiki/ArticleUtf7">UTF-7&nbsp;fallback cross-scripting technique</a>. Always setting this meta will protect against these risks.</li>
  <li>This {{HTMLElement("meta")}} element is a synonym for the pre-HTML5 <code>&lt;meta&nbsp;http-equiv="Content-Type" content="text/html;&nbsp;charset=<em>IANAcharset</em>"&gt; </code>where <em><code>IANAcharset</code> </em>corresponds of the value of the equivalent {{htmlattrxref("charset", "meta")}} attribute. This syntax is still allowed, although obsolete and no longer recommended.</li>
 </ul>
 </div>
 </dd>
 <dt>{{htmlattrdef("content")}}</dt>
 <dd>This attribute gives the value associated with the {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("name", "meta")}} attribute, depending of the context.</dd>
 <dt>{{htmlattrdef("http-equiv")}}</dt>
 <dd>This enumerated attribute defines the pragma that can alter servers and user-agents behavior. The value of the pragma is defined using the {{htmlattrxref("content", "meta")}} and can be one of the following:
 <dl>
  <dt><code>"content-language"</code> {{obsolete_inline}}</dt>
  <dd>This pragma defines the default language of the page.
  <div class="note">Do not use this pragma, as it is obsolete. Use the global <code>lang</code> attribute on the {{HTMLElement("html")}} element instead.</div>
  </dd>
  <dt><code>"Content-Security-Policy"</code></dt>
  <dd>This value allows web site administrators to define <a href="/en-US/docs/Web/Security/CSP/CSP_policy_directives">content policies</a> for served resources. With a few exceptions, policies mostly involve specifiying server origins and script endpoints. This helps guard against cross-site scripting attacks.</dd>
  <dt><code>"content-type"</code> {{obsolete_inline}}</dt>
  <dd>This attribute defines the <a href="/en-US/docs/MIME" title="MIME">MIME type</a> of the document, eventually followed by its character set. It follows the same syntax as the HTTP <code>content-type</code> 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 '<code>text/html</code>' eventually followed by a character set with the following syntax:'<code>; charset=</code><em><code>IANAcharset</code></em>' where <code>IANAcharset</code> is the <em>preferred MIME name</em> for a character set as <a class="external" href="https://www.iana.org/assignments/character-sets" title="https://www.iana.org/assignments/character-sets">defined by the IANA.</a>
  <div class="note"><strong>Usage note:</strong>
  <ul>
   <li>Do not use this pragma as it is obsolete. Use the {{htmlattrxref("charset", "meta")}} attribute on the {{HTMLElement("meta")}} element instead.</li>
   <li>As the {{HTMLElement("meta")}} may not be used to change the type of a document in an XHTML document, or in an HTML5 document following the XHTML syntax, never set MIME&nbsp;type to an XHTML MIME type that way. It would be incorrect.</li>
   <li>Only an HTML document can use the content-type, so most of it is redundant: that's why it has been obsoleted and replaced by the {{htmlattrxref("charset", "meta")}} attribute.</li>
  </ul>
  </div>
  </dd>
  <dt><code>"default-style"</code></dt>
  <dd>This pragma specifies the preferred stylesheet to be used on the page. The {{htmlattrxref("content", "meta")}} attribute must contain the <strong>title</strong>&nbsp;of a {{HTMLElement("link")}} element whose {{htmlattrxref("href", "link")}} attribute links to a CSS stylesheet, or the <strong>title</strong>&nbsp;of a {{HTMLElement("style")}} element which contains a <a href="/en-US/docs/Web/CSS" title="CSS">CSS</a> stylesheet.</dd>
  <dt><code>"refresh"</code></dt>
  <dd>This pragma specifies:
  <ul>
   <li>the number of seconds until the page should be reloaded, if the {{htmlattrxref("content", "meta")}} attribute contains only a positive integer number;</li>
   <li>the number of seconds until the page should be redirected to another, if the {{htmlattrxref("content", "meta")}} attribute contains a positive integer number followed by the string '<code>;url=</code>' and a valid URL.</li>
  </ul>
  </dd>
  <dt><code>"set-cookie"</code> {{obsolete_inline}}</dt>
  <dd>This pragma defines a <a href="/en-US/docs/cookie" title="cookie">cookie</a> for the page. Its content must follows the syntax defines in the <a class="external" href="https://tools.ietf.org/html/draft-ietf-httpstate-cookie-14" title="https://tools.ietf.org/html/draft-ietf-httpstate-cookie-14">IETF HTTP Cookie Specification</a>.
  <div class="note"><strong>Note:</strong> Do not use this pragma as it is obsolete. Use the HTTP header set-cookie instead.</div>
  </dd>
 </dl>
 </dd>
 <dt>{{htmlattrdef("name")}}</dt>
 <dd>This attribute defines the name of document-level metadata. It should not be set if one of the attributes {{htmlattrxref("itemprop", "meta")}}, {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("charset", "meta")}} is also set.<br />
 This document-level metadata name is associated with a value, contained by the {{htmlattrxref("content", "meta")}} attribute. The possible values for the name element are, with their associated value, stored via the {{htmlattrxref("content", "meta")}} attribute:
 <ul>
  <li><code>application-name</code>, defining the name of the web application running in the webpage;
   <div class="note"><strong>Note:</strong>
   <ul>
    <li>Browsers may use this to identify the application. It is different from the {{HTMLElement("title")}} element, which usually consist of the application name but may also contain specific information like the document name or a status;</li>
    <li>Simple webpages shouldn't define the application-name meta.</li>
   </ul>
   </div>
  </li>
  <li><code>author</code>, defining, in a free format, the name of the author of the document;</li>
  <li><code>description</code>, containing a short and accurate summary of the content of the page. Several browsers, among them Firefox and Opera, use this meta as the default description of the page when bookmarked;</li>
  <li><code>generator</code>, containing, in a free format, the identifier to the software that generated the page;</li>
  <li><code>keywords</code>, containing, as strings separated by commas, relevant words associated with the content of the page;</li>
  <li><code>referrer</code> {{experimental_inline}} controlling the content of the HTTP <code>Referer</code> HTTP header attached to any request sent from this document:
   <table class="standard-table">
    <caption>Values for the content of &lt;meta name="referrer"&gt;</caption>
    <thead>
    </thead>
    <tbody>
     <tr>
      <td><code>no-referrer</code></td>
      <td>Do not send a HTTP <code>Referer</code> header.</td>
     </tr>
     <tr>
      <td><code>origin</code></td>
      <td>Send the <a href="/en-US/docs/Glossary/Origin">origin</a> of the document.</td>
     </tr>
     <tr>
      <td><code>no-referrer-when-downgrade</code></td>
      <td>Send the <a href="/en-US/docs/Glossary/Origin">origin</a> as referrer to a-priori as-much-secure destination (https-&gt;https), but doesn't send a referrer to a less secure destination (https-&gt;http). This is the default behavior.</td>
     </tr>
     <tr>
      <td><code>origin-when-crossorigin</code></td>
      <td>Send a full URL (stripped from parameters) when performing a same-origin request, but only send the <a href="/en-US/docs/Glossary/Origin">origin</a> of the document for other cases.</td>
     </tr>
     <tr>
      <td><code>unsafe-URL</code></td>
      <td>Send a full URL (stripped from parameters) when perfoming a a same-origin or cross-origin request.</td>
     </tr>
    </tbody>
   </table>

   <div class="note">
   <p><strong>Note:&nbsp;</strong>Some browsers support keywords <code>always</code>, <code>default</code>, and <code>never</code> for referrer. These values are deprecated.&nbsp;&nbsp;</p>
   </div>

   <div class="note">
   <div class="notes"><strong>Note:</strong> Dynamically inserting <code>&lt;meta name="referrer"&gt;</code> (by document.write or appendChild) create a non-determinism when it comes to sending referrers or not. Note also that when several conflicting policies are defined, the No-referrer policy is applied.</div>
   </div>
  </li>
 </ul>

 <p>The attribute may also have a value taken from the extended list defined on <a class="external" href="https://wiki.whatwg.org/wiki/MetaExtensions" title="https://wiki.whatwg.org/wiki/MetaExtensions">WHATWG Wiki MetaExtensions page</a>. Although none has been formally accepted yet, a few commonly used names are among the proposals:</p>

 <ul>
  <li><code>creator</code>, defining, in a free format, the name of the creator of the document. Note that it can be the name of the institution. If there are more than one, several {{HTMLElement("meta")}} elements should be used;</li>
  <li><code>googlebot</code>, which is a synonym of <code>robots</code>, but is only followed by Googlebot, the indexing crawler for Google;</li>
  <li><code>publisher</code>, defining, in a free format, the name of the publisher of the document. Note that it can be the name of the institution;</li>
  <li><code>robots</code>, defining the behavior that cooperative crawlers should have with the page. It is a comma-separated list of values taken in the following list:
   <table class="standard-table">
    <caption>Values for the content of &lt;meta name="robots"&gt;</caption>
    <thead>
     <tr>
      <th scope="col">Value</th>
      <th scope="col">Description</th>
      <th scope="col">Used by</th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td><code>index</code></td>
      <td>Allows the robot to index the page</td>
      <td>All</td>
     </tr>
     <tr>
      <td><code>noindex</code></td>
      <td>Prevents the robot from indexing the page</td>
      <td>All</td>
     </tr>
     <tr>
      <td><code>follow</code></td>
      <td>Allows the robot to follow the links on the page</td>
      <td>All</td>
     </tr>
     <tr>
      <td><code>nofollow</code></td>
      <td>Prevents the robot from following the links on the page</td>
      <td>All</td>
     </tr>
     <tr>
      <td><code>noodp</code></td>
      <td>Prevents the usage of the <a class="external" href="https://www.dmoz.org/" title="https://www.dmoz.org/">Open Directory Project</a> description, if any, as the description of the page in the search engine results page</td>
      <td>
       <p><a class="external" href="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a>, <a class="external" href="https://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4" title="https://help.yahoo.com/l/us/yahoo/search/indexing/indexing-11.html;_ylt=Arh3LHnisvRMPJKzQqmJ97JYqCN4">Yahoo</a>, <a class="external" href="https://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx" title="https://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx">Bing</a></p>
      </td>
     </tr>
     <tr>
      <td><code>noarchive</code></td>
      <td>Prevents the search engine from caching the content of the page</td>
      <td><a class="external" href="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a>, <a class="external" href="https://help.yahoo.com/l/us/yahoo/search/indexing/basics-10.html;_ylt=Aszma_Ly8TfhL7mn_LGWn5RYqCN4" title="https://help.yahoo.com/l/us/yahoo/search/indexing/basics-10.html;_ylt=Aszma_Ly8TfhL7mn_LGWn5RYqCN4">Yahoo</a></td>
     </tr>
     <tr>
      <td><code>nosnippet</code></td>
      <td>Prevents the display of any description of the page in the search engine results page</td>
      <td><a class="external" href="https://www.google.com/support/webmasters/bin/answer.py?answer=35304" title="https://www.google.com/support/webmasters/bin/answer.py?answer=35304">Google</a></td>
     </tr>
     <tr>
      <td><code>noimageindex</code></td>
      <td>Prevents this page from appearing as the referring page of an indexed image</td>
      <td><a class="external" href="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812" title="https://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=79812">Google</a></td>
     </tr>
     <tr>
      <td><code>nocache</code></td>
      <td>Synonym of <code>noarchive</code></td>
      <td><a class="external" href="https://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx" title="https://www.bing.com/toolbox/blogs/webmaster/archive/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation.aspx">Bing</a></td>
     </tr>
    </tbody>
   </table>

   <div class="note"><strong>Notes:</strong>

   <ul>
    <li>Only cooperative robots will follow the rules defined by the robots name. Do not expect to keep e-mail harvesters at bay with this.</li>
    <li>The robot still needs to access the page in order to read the meta value. If you want to keep them at bay, for example to prevent bandwidth consumption, use a <em><a href="/en-US/docs/Robot_Exclusion_Protocol" title="Robot Exclusion Protocol">robots.txt</a></em> file instead (or in complement).</li>
    <li>If you want to remove the page of an index, changing the meta to <code>noindex</code> will work, but only when the robot visit the page again. Be sure not to prevent such visits, via the <em>robots.txt</em> file for example. Some search engines have developers tools, allowing a quick removal of some page.</li>
    <li>Some possible values are mutually exclusive, like using <code>index</code> and <code>noindex</code>, or <code>follow</code> and <code>nofollow</code>, at the same time. In these cases the behavior of the robot is undefined, and may vary from one to the other. So avoid these cases.</li>
    <li>Some search engine crawler robots, like those of Google, Yahoo Search or Bing, support the same values on an HTTP directive, <code>X-Robot-Tags</code>: this allows them to use these pragma on non-HTML documents, like images.</li>
   </ul>
   </div>
  </li>
  <li><code>slurp</code>, which is a synonym of <code>robots</code>, but is only followed by Slurp, the indexing crawler for Yahoo Search;</li>
 </ul>

 <p>Finally a few names are in common use, though not in progress of being standardized:</p>

 <ul>
  <li><code>viewport</code>, which gives hints about the size of the initial size of the {{glossary("viewport")}}. This pragma is used by several mobile devices only.

   <table class="fullwidth-table">
    <caption>Values for the content of <code>&lt;meta name="viewport"&gt;</code></caption>
    <thead>
     <tr>
      <th scope="col">Value</th>
      <th scope="col">Possible values</th>
      <th scope="col">Description</th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td><code>width</code></td>
      <td>a positive integer number or the literal <code>device-width</code></td>
      <td>defines the width, in pixels, of the viewport</td>
     </tr>
     <tr>
      <td><code>height</code></td>
      <td>a positive integer number or the literal <code>device-height</code></td>
      <td>defines the height, in pixels, of the viewport</td>
     </tr>
     <tr>
      <td><code>initial-scale</code></td>
      <td>a positive number between <code>0.0</code> and <code>10.0</code></td>
      <td>defines the ratio between the device width (<code>device-width</code> in portrait mode or <code>device-height</code> in landscape mode) and the viewport size.</td>
     </tr>
     <tr>
      <td><code>maximum-scale</code></td>
      <td>a positive number between <code>0.0</code> and <code>10.0</code></td>
      <td>defines the maximum value of the zoom; it must be greater or equal to the <code>minimum-scale</code> or the behavior is indeterminate.</td>
     </tr>
     <tr>
      <td><code>minimum-scale</code></td>
      <td>a positive number between <code>0.0</code> and <code>10.0</code></td>
      <td>defines the minimum value of the zoom; it must be smaller or equal to the <code>maximum-scale</code> or the behavior is indeterminate.</td>
     </tr>
     <tr>
      <td><code>user-scalable</code></td>
      <td>a boolean value (<code>yes</code> or <code>no</code>)</td>
      <td>If set to <code>no</code>, the user is not able to zoom in the webpage. Default value is <code>yes</code>.</td>
     </tr>
    </tbody>
   </table>

   <table class="standard-table">
    <thead>
     <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td>{{SpecName('CSS3 Device', '#viewport-meta', '&lt;meta name="viewport"&gt;')}}</td>
      <td>{{Spec2('CSS3 Device')}}</td>
      <td>Non-normatively describes the Viewport META element</td>
     </tr>
    </tbody>
   </table>

   <div>See also: {{cssxref("@viewport")}}</div>

   <div class="note"><strong>Notes:</strong>

   <ul>
    <li>Though not standardized, this attribute is used by different mobile browsers like Safari Mobile, Firefox for Mobile or Opera Mobile.</li>
    <li>The default values may change from one device, and browser, to another.</li>
    <li>To learn about this pragma in Firefox for Mobile, see <a href="/en-US/docs/Mobile/Viewport_meta_tag" title="Mobile/Viewport meta tag">this article</a>.</li>
   </ul>
   </div>
  </li>
 </ul>
 </dd>
 <dt>{{htmlattrdef("scheme")}} {{obsolete_inline}}</dt>
 <dd>This attribute defines the scheme in which the metadata is described. A scheme is a context leading to the correct interpretations of the {{htmlattrxref("content", "meta")}} value, like a format.
 <div class="note"><strong>Notes:</strong> Do not use this attribute as it is obsolete. There is no replacement for it as there was no real usage for it. Omit it altogether.</div>
 </dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre class="brush: html">
&lt;!-- In HTML5 --&gt;
&lt;meta charset="utf-8"&gt;

&lt;!-- Defining the charset in HTML4 --&gt; 
&lt;!-- Note: This is invalid in HTML5 --&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;!-- Redirect page after 3 seconds --&gt;
&lt;meta http-equiv="refresh" content="3;url=https://www.mozilla.org/"&gt;

</pre>

<h2 id="Specifications" name="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('Referrer Policy', '#referrer-policy-delivery-meta', '&lt;meta name="referrer"&gt;')}}</td>
   <td>{{Spec2('Referrer Policy')}}</td>
   <td>Defines values and semantics of <code>&lt;meta name="referrer"&gt;</code>.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'semantics.html#the-meta-element', '&lt;meta&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>Added <code>itemprop</code> attribute</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'document-metadata.html#the-meta-element', '&lt;meta&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Added <code>charset</code> attribute</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'struct/global.html#h-7.4.4.2', '&lt;meta&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("1.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>name="referrer"</code></td>
   <td>{{CompatChrome("17")}}</td>
   <td>{{CompatGeckoDesktop("36.0")}} [1]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Constrained to values listed under referrer (as specified in the spec.)</td>
   <td>{{CompatChrome("46.0")}}</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Android Webview</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("1.0")}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>name="referrer"</code></td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile("36.0")}} [1]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td>Constrained to values listed under referrer (as specified in the spec.)</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatChrome("46.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatChrome("46.0")}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] The <code>referrer</code> value wasn't taken into account when navigation was happening via the context menu or middle click until Firefox 39.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>The other elements containing metadata: {{HTMLElement("base")}}, {{HTMLElement("head")}}, {{HTMLElement("link")}}, {{HTMLElement("style")}},{{HTMLElement("title")}}.</li>
</ul>
Revert to this revision