--- title: ': Element metadanych na poziomie dokumentów' slug: Web/HTML/Element/meta translation_of: Web/HTML/Element/meta ---
Element HTML <meta>
reprezentuje {{Glossary("Metadata","metadane")}}, które nie mogą być reprezentowane przez inne elementy związane z metadanymi w HTML, takie jak {{HTMLElement("base")}}, {{HTMLElement("link")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}} lub {{HTMLElement("title")}}.
Kategorie treści | Metadata content. If the {{htmlattrxref("itemprop")}} attribute is present: flow content, phrasing content. |
---|---|
Dozwolona zawartość | None, it is an {{Glossary("empty element")}}. |
Pominięcie znacznika | As it is a void element, the start tag must be present and the end tag must not be present. |
Dozwoleni rodzice | <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. |
Domniemane role ARIA | No corresponding role |
Dozwolone role ARIA | No role permitted |
Interfejs DOM | {{domxref("HTMLMetaElement")}} |
The type of metadata provided by the meta
element can be one of the following:
meta
element provides document-level metadata, applying to the whole page.meta
element is a pragma directive, providing information equivalent to what can be given by a similarly-named HTTP header.meta
element is a charset declaration, giving the character encoding in which the document is encoded.meta
element provides user-defined metadata.This element includes the global attributes.
Note: the attribute {{htmlattrxref("name", "meta")}} has a specific meaning for the <meta>
element, and the {{htmlattrxref("itemprop")}} attribute must not be set on the same <meta>
element that has any existing {{htmlattrxref("name", "meta")}}, {{htmlattrxref("http-equiv", "meta")}} or {{htmlattrxref("charset", "meta")}} attributes.
utf-8
".Defines a pragma directive. The attribute is named http-equiv(alent)
because all the allowed values are names of particular HTTP headers:
content-security-policy
Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks.
content-type
If specified, the content
attribute must have the value "text/html; charset=utf-8
". Note: Can only be used in documents served with a text/html
MIME type — not in documents served with an XML MIME type.
default-style
Sets the name of the default CSS style sheet set.
x-ua-compatible
If specified, the content
attribute must have the value "IE=edge
". User agents are required to ignore this pragma.
refresh
;url=
', and a valid URL.refresh
value run the risk of having the time interval being too short. People navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. The abrupt, unannounced updating of the page content may also be disorienting for people experiencing low vision conditions.The 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.
See standard metadata names for details about the set of standard metadata names defined in the HTML specification.
<meta charset="utf-8"> <!-- Redirect page after 3 seconds --> <meta http-equiv="refresh" content="3;url=https://www.mozilla.org">
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'semantics.html#the-meta-element', '<meta>')}} | {{Spec2('HTML WHATWG')}} |