Previous Next

HTML Metadata Elements

  • In HTML document you can define multiple meta <meta> elements.
  • HTML meta elements define information about the HTML document in the form of key/value pair.
  • Meta elements can define information like page description, keywords in HTML document, author, date etc.
  • Meta elements are also crawled by search engines for indexing the HTML document.
  • Meta elements are defined in the head section of HTML document.
  • Meta tags are not visible.

 

HTML Meta Element

HTML meta element can contain following attributes:

Name Name defines meta property name for example: keywords, description, author, revised, generator etc.
content Content specifies the meta property's value.
scheme Specifies a scheme to interpret the property's value.
http-equiv It can be used for refreshing the content and setting the cookie.

 


 

HTML Meta Description Element

HTML document can define <meta> element to specify description which are related to HTML document.

This description is used by search engines for indexing the web page.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta name="keywords" content="HTML, Meta Tags, Metadata" />
      <meta name="description" content="HTML Metadata Tutorial." />
   </head>
   <body>
      <p>HTML Meta tags!</p>
   </body>
</html>


 

HTML Meta Keywords Element

HTML document can define <meta> element to specify keywords which are related to HTML document.

These keywords are used by search engines for indexing the web page.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta name="keywords" content="HTML, Meta Tags, Metadata" />
   </head>
   <body>
      <p>HTML Meta tags!</p>
   </body>
</html>

 


 

HTML Meta Revision Date Element

HTML document can define revised <meta> element to specify when document was last updated. 

This information can be used by web browsers while refreshing your webpage.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
     <meta name="revised" content="Tutorialsright, 9/12/2016" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html>

 

HTML Meta Refresh Element

HTML document can define <meta> element to automatically refresh web page after specific duration.

Example

Below HTML document will keep refreshing after every 10 seconds.

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta http-equiv="refresh" content="10" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html>


 

HTML Page Redirection 

HTML document can define <meta> element to automatically redirect to any other url. 

You can also specify duration to wait before redirection.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta http-equiv="refresh" content="4; url=https://www.tutorialsright.com" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html>


 

HTML Meta Cookies Element

Cookies can store information about the visitor. This information is stored on visitors computer in form of small text files.

Through cookies, the web server can remember information about the visitor like their name. 

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta http-equiv="cookie" content="name=Lynda; expires=Sunday, 12-Sep-16 23:59:59 GMT;" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html>

If expiration date and time not specified, the cookie will be deleted when the user exits the browser.

 


 

HTML Meta Author Element

HTML document can define <meta> element to specify author name.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta name="author" content="John Doe" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html> 

 


 

HTML Meta Charset Element

HTML document can define <meta> element to specify character set used within the webpage.

Default charset is ISO-8859-1 (Latin1) encoding.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Meta Tags Example</title>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   </head>
   <body>
      <p>HTML Tutorials!</p>
   </body>
</html>

 


Previous Next