HTML Meta Tags

The term metadata refers to data about data. It is information about the document rather than the content of the document.

HTML Meta Tags :

  1. The <meta> tag provides information about the HTML document
  2. The <meta> tag is an empty tag which does not have closing tag associated with it
  3. The <meta> tag contain the specific information within attribute.
  4. The <meta> tag provides information to the search engine such as content of the page , author of the document etc
  5. The <meta> tag information is not displayed in the webpage
  6. The <meta> tag information is used by browsers,search engines and different web services.
  7. The <meta> tag information is always written inside the <head> section of the web page.

Attributes of Meta Tags :

As stated above, meta information is always written within the attributes. Below are the different attributes used by Meta tags -

Attribute Description
Name Name attribute is used to specify the type of mete information to be displayed. It can be keywords,description, author,revised,generator etc.
content Specifies the value or content of the meta tag
scheme Specifies a Scheme to use to interpret the meta tag's value
http-equiv Used for http response message headers.

Meta Tag Examples :

1. Define keywords for Search Engines :

We can define the keywords for the webpage using the meta tag attribute “keywords“. It is used to tell importatnt keywords of the page using keyword attribute.

<meta name="keywords" content="HTML,CSS">

Nowdays Search engines are intelligent enough to identify the keywords of the page by parsing complete page so most of the search engines are not using this meta information.

2. Define description of Web Page :

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

3. Define author :

Meta tag provides us the way to define the author of the webpage. Author attribute used to specify the author of the webpage.

<meta name="author" content="Pritesh Taral">

4. Refresh document after every 10 seconds :

Some times it is required to refresh the webpage after some time interval. In that case following meta information will do work for you.

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

Time interval is defined in seconds. So the above meta information will refresh the page after 10 seconds.

5. Document Revision date :

When document is updated after the longer period then following meta information will provide information to search engine that this document has be revised on the date specified.

<meta name="revised" content="Last Revisied, 11/10/2024" />

6. Page redirection after every 10 seconds :

Following meta information will redirect the current webpage to the address specified after certain interval of time.

<meta http-equiv="refresh" 
         content="10; url=https://www.c4learn.com" />

Above tag will redirect the webpage to the address specified after 10 seconds