Tag Description
The meta tag is used to provide metadata about the HTML document. Metadata is not rendered on the page, but is browser parsable.
Metadata elements are typically used to specify the document description, keywords, and author information.
This tag has the form:
<meta content="text" { http-equiv="http response header" | name="text" } />
Note: The <meta>
tag must be placed within the head element.
HTML5 and HTML4.01 Differences
The "scheme" attribute is not supported in HTML5.
HTML5 has a new attribute, charset, which makes it easier to define charset.
HTML5 | = New for HTML5 |
Attributes
Attribute | Value | Description |
---|---|---|
charsetHTML5 | character_set | Specifies the character encoding of the linked document |
content | text | Specifies the content of the meta information
Required in HTML4.01, but not in HTML5 |
http-equiv | content-type
default-style refresh |
Provides an HTTP header for the information in the content attribute |
name | application-name
author description generator keywords |
Provides a name for the information in the content attribute |
scheme | format/URI | Specifies a scheme to be used to interpret the value of the content attribute
HTML4:
![]() HTML5:
![]() |
Global Attributes
This tag also supports the HTML Global Attributes.
Event Attributes
None supported.
Examples
The following examples show the basic use of this tag:
Example 1
This example shows some definitions for keywords, description, and author:
<head>
<meta name="description" content="Example web site" />
<meta name="keywords" content="Example, Test" />
<meta name="author" content="John Q. Public" />
</head>
Example 2
This example shows the differences in defining a charset for HTML4.01 and HTML5:
HTML4.01:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
HTML5:
<meta charset="utf-8">
Example 3
This example refreshes the page every 5 seconds:
<meta http-equiv="refresh" content="5" />
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
Doctype Declaration Support
The following table lists the doctype declarations this element may appear in:
HTML4.01 / XHTML1.0 | XHTML 1.1 | HTML 5 | ||
---|---|---|---|---|
Traditional | Strict | Frameset | ||
Miscellaneous Information
Defined In: | HTML 2 |
---|---|
Empty Tag: | Yes |