Meta Tag in HTML5

Meta Tag

The <meta> tag specifies metadata for the document. The Metadata will not be displayed on the page, but will be machine parsable. The HTML <meta>tag is for declaring metadata for the HTML document. Metadata can include description, keyword, author, etc. It is also used to refresh the page. The meta tag is placed between opening and closing <head> tags.

Metadata is data (information) about data. The <meta> tag can be used by the browsers, search engines or other web services. It provides the information for search engines of your page such as description, refresh, keyword, etc. The <meta> tag always goes inside the <head> tag. Metadata is always ed as name/value pairs. The Content attribute must be defined if the name or the http-equiv attribute is defined. If none of these are defined then the content attribute cannot be defined.

HTML5 has a new attribute charset, that make it easier to define the charset.


The syntax of the <meta> tag is:

<meta name="value" content="value" http-equiv="value" charset="value"/>

Browser Support

The <meta> tag is supported in all major browsers.

Attributes of Meta Tag

The <meta> tag has four attributes; they are:

  • name="value"

          the name attribute has the following values:

          application name: This value represents the name of the web application.

          author: The value is a string and must specify the name of the author of the page.

          description: The value specifies the description of the web page.

          generator: The value specifies the name of software package used.

          keyword: These represent the keywords of the page.

  • http-equiv="value"

          This attribute has the following values:

          refresh: To set the refresh time of the web page.

          default-style: To provide the style sheet set.

          content-language: the language of the document.

  • content="value"

          It specifies the metadata of the document.

  • charset="value"

          It specifies the character encoding used in the document.

Example of the <meta> tag in HTML5

<!DOCTYPE html>


<html lang="en" xmlns="">


<title>Meta Tag in HTML5</title>

<meta name="description" content="Html5 article"/>

<meta name="keywords" content="c#,html5,,meta tag"/>

<meta name="generator" content="Frontpage"/>

<meta name="description" content="Html5 article"/>

<meta name="author" content="Ashwani Tyagi"/>

<meta name="description" content="Html5 article"/>

<meta http-equiv="refresh" content="5;url="/>

<meta charset="UTF-8"/>



<p>It is used to Specify the metadata of the document.</p>





Page redirected to Gmail page