HTML <meta> (Meta-Information) Tag
Example
<head>
<meta charset="UTF-8">
<meta name="language" content="EN">
<meta name="description" content="add up to 160 characters">
<meta name="keywords" content="your, keywords">
<meta name="robots" content="index, follow">
<meta name="copyright"content="company">
<meta name="author" content="John Doe, [email protected]">
<meta name="distribution" content="Global">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Meaning
The <meta> element specifies general information about a document that can be used in document indexing.
It also allows a document to define fields in the HTTP response header when it is sent from the server.
Version: HTML 2, 3.2, 4, 4.01, 5
Standard Syntax
HTML: <meta name="application-name|author|description|generator|keywords|viewport" content="text">
XHTML: <meta name="application-name|author|description|generator|keywords|viewport" content="text" />
Browser Support
Status
Attributes
Attribute | Value | Description |
---|---|---|
charset | characterSet | Specifies the character encoding used by the document. |
content | text | Gives the value of the document metadata or pragma directive when the element is used for those purposes. |
http-equiv | content-security-policy content-type default-style refresh |
When the http-equiv attribute is specified on a meta element, the element is a pragma directive. |
name | application-name author description generator keywords viewport |
Specifies a name for the metadata |
Global Attributes
<meta> element also supports the Global Attributes in HTML.
More Examples
Define the character encoding for the document:
HTML: <meta charset="UTF-8">
XHTML: <meta charset="UTF-8" />
Define keywords for search engines
HTML: <meta name="keywords" content="your, keywords">
XHTML: <meta name="keywords" content="your, keywords" />
Define description for search engines
HTML: <meta name="description" content="description up to 160 character">
XHTML: <meta name="description" content="description up to 160 character" />
Define a description of your web page:
HTML: <meta name="author" content="John Doe, [email protected]">
XHTML: <meta name="author" content="John Doe, [email protected]" />
Refresh document every 1 minute:
HTML: <meta http-equiv="refresh" content="60">
XHTML: <meta http-equiv="refresh" content="60" />
Setting the viewport to make your website look good on all devices:
HTML: <meta name="viewport" content="width=device-width, initial-scale=1.0">
XHTML: <meta name="viewport" content="width=device-width, initial-scale=1.0" />
By Default CSS Value(s)
None.