HTML <meta>Tag


Examples

Describes the metadata of an HTML document:

<head> <meta name="description" content="Free Online Tutorial"> <meta name="keywords" content="HTML,CSS,XML,JavaScript"> <meta name="author" content="example"> <meta charset="UTF-8"> </head>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <meta> tag.


Definition and Usage

Metadata is data information about data.

The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the client side, but will be parsed by the browser.

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

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 within the <head> area.

Note:Metadata is usually expressed in name/value pairs.

Note:If the name attribute is not 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, which makes the definition of the character set 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 has no closing tag.

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


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="Hege Refsnes">

Example 4 - Refresh the page every 30 seconds:

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


Attributes

New: New in HTML5.

Attributes Value Description
charsetNew character_set Defines the character encoding of the document.
content text Defines the meta information related to the http-equiv or name attribute.
http-equiv content-type
default-style
refresh
Associates the content attribute with an HTTP header.
name application-name
author
description
generator
keywords
Associates the content attribute with a name.
scheme format/URI Not supported in HTML5.Defines a format used to translate the value of the content attribute.


Event Attributes

The <meta> tag supports allHTML Event Attributes。


Related Articles

HTML Tutorial:HTML Head

Other Extensions