English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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.
IEFirefoxOperaChromeSafari
All mainstream browsers support the <meta> tag.
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.
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.
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">
In HTML, the <meta> tag does not have a closing tag.
In XHTML, the <meta> tag must contain a closing tag.
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">
New: HTML5 New attribute.
Attribute | Value | Description |
---|---|---|
charsetHTML5 | character_set | Define the character encoding of the document. |
content | text | Define meta-information related to http-equiv or name attribute related meta-information. |
http-equiv | content-type default-style refresh | Associate the content attribute with HTTP headers. |
name | application-name author description generator keywords | Associate the content attribute with a name. |
scheme | format/URI | HTML5Does not support. Define the format for translating the content attribute value. |
<meta> tag supports all HTML Event Attributes.
HTML Tutorial:HTML Header