HTML Meta Tags



The HTML meta tag is used to add extra information to the document. The meta tag has no closing tag so, its an empty element. We only have the opening tag with some attributes.

Attributes of the meta tag

We use the following attributes in the opening meta tag.

The value of this attribute is for the property name. For example, keywords and author.

This attribute is used to specify the property content. For example, if value of the name attribute is keywords then value of the content attribute can be html, css etc.

The http-equiv provides HTML header for the value of the content attribute.

keywords Meta Tag

To specify the keywords for the web page we set the name attribute to keywords. Following is a keywords meta tag.

<meta name="keywords" content="html,css,js,tutorial,dyclassroom">

author Meta Tag

To specify the author of the web page we set the name attribute to author.

<meta name="author" content="Yusuf Shakeel">

description Meta Tag

To specify the web page description we set the name attribute to description.

<meta name="description" content="HTML Tutorial">

revision Meta Tag

To express the last modified time stamp of the web page we use the revision meta tag.

<meta name="revision" content="Lastmodified: 2016-01-01">

Document refreshing Meta Tag

To make the web page auto refresh we set the http-equiv to refresh and set the content value to the number of seconds. Following example will refresh the web page every 15 seconds

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

Redirecting Meta Tag

We can also use the http-equiv to redirect to a web page by setting the content attribute value to the web page link.

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

If we want to redirect to redirect to a web page after say 25 seconds then we use the following meta tag.

<meta http-equiv="refresh" content="25;">