Play this article
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?
- Specifies Keywords for search engines to identify:
<meta name="keywords" content="HTML, CSS, JavaScript">
- Adds the description to the web pages:
<meta name="description" content="Learn Code Online">
- Adds authors name for the webpage:
<meta name="author" content="Prahlad Inala">
- Make it look responsive on any devices
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Attributes in meta tags
- name - This attribute is used for specifies the name of the metadata. ( values- application-name, author, description, generator, keywords, viewport )
- charset - charset specifies the character encoding for Html doc.
- content - it specifies the value associated with http-equiv or name attribute.
- http-equiv - it provides an HTTP header for information or value.
ย