English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Encyclopedia

HTML: <meta> tag

The HTML <meta> tag contains information or metadata that is not directly visible on the web page but used by browsers and search engines. This tag is also commonly referred to as the <meta> element.

Online examples

Describe the metadata of HTML documents:

!doctype html
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="The HTML meta tag is an element that resides within the HTML head tag.">
<meta name="keywords" content="html, meta, tag, element">
<meta name="author" content="www.oldtoolbag.com">
<title>Basic Tutorial Website(oldtoolbag.com)</title>
</head>
<body>
</body>
</html>
Test to see ‹/›


in this HTML5document example, we created5meta tags. The first meta tag (charset)defines the character encoding of the HTML document. When designing a responsive website, the second meta tag (viewport). The third meta tag (description) provides a description for the search engine's web page. The fourth metadata (Keywords)provides keywords for search engines. The final meta tag (author) defines the author of the web page.

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <meta> tag.

Tag definition and usage instructions

Metadata (Metadata) is the information of the data.

The <meta> tag provides metadata for the HTML document. Metadata is not displayed on the client, but is parsed by the browser.

The META element is usually used to specify the description, keywords, file last modified time, author, and other metadata of the web page.

Metadata can be used by browsers (how to display content or reload the page), search engines (keywords), or other Web services.

Tips and Notes

Note:The <meta> tag is usually located in the <head> area.

Note:  Metadata is usually in the/value pair appears.

Note: If the name attribute is not provided, then the name/The names in the value pair will use http-equiv attribute values.

HTML 4.01 with HTML5differences

HTML5 does not support the scheme attribute.

In HTML5 In this version, there is a new charset attribute that makes the definition of character sets easier:

  • HTML 4.01: <meta http-equiv="content-type" content="text/html; charset=UTF-8">

  • HTML5: <meta charset="UTF-8">

Differences between HTML and XHTML

In HTML, the <meta> tag does not have a closing tag.

In XHTML, the <meta> tag must contain a closing tag.

Online examples

Example 1 - Define document keywords for search engines:

<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">

Example 2 - Define the web page description:

<meta name="description" content="Free Web tutorials on HTML and CSS">

Example 3 - Define the page author:

<meta name="author" content="nhoo.com">

Example 4 - Every3Refresh the page every 0 seconds:

<meta http-equiv="refresh" content="30">

Attribute

New: HTML5 New attribute.

AttributeValueDescription
charsetHTML5character_setDefine the character encoding of the document.
contenttextDefine meta-information related to http-equiv or name attribute related meta-information.
http-equivcontent-type
 default-style
 refresh
Associate the content attribute with HTTP headers.
nameapplication-name
 author
 description
 generator
 
keywords
Associate the content attribute with a name.
schemeformat/URIHTML5Does not support. Define the format for translating the content attribute value.

event attributes

<meta> tag supports all HTML Event Attributes.

Related Articles

HTML Tutorial:HTML Header