HTML <meta> Tag

Description

The <meta> HTML element defines the data (they are also called meta tags) that are used to store information intended for browsers and search engines. For example, search engine mechanisms use meta tags to get site descriptions, keywords, and other data. It is allowed to use more than one meta tag, all of them are placed in the <head> container. As a rule, the attributes of any meta tag are reduced to "name = value" pairs whose names are determined by the keywords content , name or http-equiv.

Properties

Permitted Parents
<meta charset>, <meta http-equiv>: a <head> element. If the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element
Content
None. It is an empty element.
Start/End Tags
Start tag: required, End tag: forbidden

Example

<head>
<meta charset="UTF-8">
<meta name="description" content="Description of website">
<meta name="keywords" content="Keywords Used">
<meta name="author" content="Authors Name">
</head>

Attributes

Attribute Definition
charset Specifies the character encoding for the HTML document
content Specifies the property's value.
http-equiv Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.
name Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc.
scheme Specifies a scheme to use to interpret the property's value (as declared in the content attribute).

Global Attributes

The <meta> tag also supports the Global Attributes in HTML5

Event Attributes

The <meta> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
YesYesYes1YesYes
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4YesYesYes

Last updated by CSSPortal on: 6th December 2019