Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML tag

HTML tag

Example

Describing metadata of an HTML document:

<head>
<meta name="description" content=">

Free online tutorials

"

<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="runoob">
<meta charset="UTF-8" head>

Try it »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support tag.


Tag Definition and Usage Notes

Metadata is information about data.

The tag provides metadata for an HTML document. Metadata is not displayed on the client but is parsed by the browser.

The META element is typically used to specify a web page's description, keywords, last modification time, author, and other metadata.

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


Tips and Notes

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

Note: Metadata usually appears as name/value pairs.

Note: If no name attribute is provided, the name in the name/value pair takes the value of the http-equiv attribute.


Differences between HTML 4.01 and HTML5

HTML5 does not support the scheme attribute.

In HTML5, there is a new charset attribute that makes defining the character set easier:


Differences between HTML and XHTML

In HTML the tag has no end tag.

In XHTML The tag must include a closing tag.


Example

Example 1 - Define document keywords for search engines:

Example 2 - Define the web page description:

Example 3 - Define the page author:

Example 4 - Refresh the page every 30 seconds:


property

New: new attribute in HTML5.

property Value Description
charsetNew character_set Defines the character encoding of the document.
content text Defines meta information related to the http-equiv or name attribute.
http-equiv content-type
 default-style       

 refresh | 把 content 属性关联到 HTTP 头部。 |

| name | application-name
author
description
generator*
*keywords | Associates the content attribute with a name. | | scheme | format/URI | Not supported in HTML5. Defines the format used to translate the value of the content attribute. |


Event attribute

The tag supports all [HTML Event Attributes](/tags/ref-eventattributes.html).

Related Articles

HTML Tutorial:The HTML head