files/en-us/web/html/reference/elements/meta/index.md
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:
name attribute is set, the <meta> element provides document-level metadata that applies to the whole page.http-equiv attribute is set, the <meta> element acts as a pragma directive to simulate directives that could otherwise be given by an HTTP header.charset attribute is set, the <meta> element is a charset declaration, giving the character encoding in which the document is encoded.itemprop attribute is set, the <meta> element provides user-defined metadata.This element includes the global attributes.
[!NOTE] The
nameattribute has a specific meaning for the<meta>element. Theitempropattribute must not be set on a<meta>element that includes aname,http-equiv, orcharsetattribute.
charset
"utf-8", because UTF-8 is the only valid encoding for HTML5 documents. <meta> elements which declare a character encoding must be located entirely within the first 1024 bytes of the document.content
http-equiv or name attribute, depending on which is used.http-equiv
http-equivalent because the allowed values are names of equivalent HTTP headers.media
media attribute defines which media the theme color defined in the content attribute should be applied to.
Its value is a media query, which defaults to all if the attribute is missing.
This attribute is only relevant when the element's name attribute is set to theme-color.
Otherwise, it has no effect, and should not be included.name
name and content attributes can be used together to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value.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." />
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" />
{{Specifications}}
{{Compat}}