What are the different <meta> tags to define special meta information in HTML page?

HTMLWeb DevelopmentFront End Technology

The <meta> tag is used to define metadata within HTML document like information, keywords, author, etc. With HTML5, you can set viewport with the <meta> tag.

Here are the different ways to add meta information and use the <meta> tag −
Author
Use the following to add the author of the web page.

<meta name="author" content="Amit">

Description
Use the following to define the description of the web page.

<meta name="description" content="Learn from Text and Video Tutorials">

Keywords
Use the following to add keywords to the web page.

<meta name="keyword" content="Java, WordPress, Drupal, Android, iOS">

To set viewport
Viewport is used to control layout on mobile browsers. It is used inside the <meta> tag to give the browser instructions on how to work for controlling the web page’s dimensions and scaling.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Example

You can try to run the following code to learn about a <meta> tag.

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <meta name="description" content="Learn from Text and Video Tutorials">
      <meta name="keywords" content="Java, WordPress, Drupal, Android, iOS">
      <meta name="author" content="Amit">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
   </head>
   <body>
      <p>This is is demo text. The head tag consists of all the meta information.</p>
   </body>
</html>
raja
Published on 01-Feb-2018 11:07:36
Advertisements