docs.rodeo

MDN Web Docs mirror

: The metadata element

The <meta> HTML element represents {{Glossary("Metadata","metadata")}}  that cannot be represented by other meta-related elements, such as {{HTMLElement("base")}} , {{HTMLElement("link")}} , {{HTMLElement("script")}} , {{HTMLElement("style")}} , or {{HTMLElement("title")}} .

The type of metadata provided by the <meta> element can be one of the following:

Attributes

This element includes the global attributes.

[!NOTE] The name attribute has a specific meaning for the <meta> element. The itemprop attribute must not be set on a <meta> element that includes a name, http-equiv, or charset attribute.

Examples

Setting a meta description

The following <meta> tag provides a description as metadata for the web page:

<meta
  name="description"
  content="The HTML reference describes all elements and attributes of HTML, including global attributes that apply to all elements." />

Setting a page redirect

The following example uses http-equiv="refresh" to direct the browser to perform a redirect. The content="3;url=https://www.mozilla.org" attribute will redirect page to https://www.mozilla.org after 3 seconds:

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

Technical summary

Content categories Metadata content. If the itemprop attribute is present: flow content, phrasing content.
Permitted content None; it is a `{{Glossary("void element")}}` .
Tag omission Must have a start tag and must not have an end tag.
Permitted parents
  • <meta charset>, <meta http-equiv>: a `{{HTMLElement("head")}}`  element. If the http-equiv is not an encoding declaration, it can also be inside a `{{HTMLElement("noscript")}}`  element, itself inside a <head> element.
  • <meta name>: any element that accepts metadata content.
  • <meta itemprop>: any element that accepts metadata content or flow content.
Implicit ARIA role No corresponding role
Permitted ARIA roles No role permitted
DOM interface `{{domxref("HTMLMetaElement")}}` 

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN