What are Meta Tags in HTML?

What are Meta Tags in HTML?

ยท

1 min read

What are Meta Tags in HTML?

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.

This is defined in the <head> tag in Html.

It defines information like description, keywords, author, viewport, and more.

<head>
  <meta charset="UTF-8">
  <meta name="description" content="Learn Code Online">
  <meta name="keywords" content="HTML, CSS, JavaScript">
  <meta name="author" content="Prahlad Inala">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

What are the uses of Meta Tags?

  1. Specifies Keywords for search engines to identify:
<meta name="keywords" content="HTML, CSS, JavaScript">
  1. Adds the description to the web pages:
  <meta name="description" content="Learn Code Online">
  1. Adds authors name for the webpage:
<meta name="author" content="Prahlad Inala">
  1. Make it look responsive on any devices
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Attributes in meta tags

  1. name - This attribute is used for specifies the name of the metadata. ( values- application-name, author, description, generator, keywords, viewport )
  2. charset - charset specifies the character encoding for Html doc.
  3. content - it specifies the value associated with http-equiv or name attribute.
  4. http-equiv - it provides an HTTP header for information or value.
ย