HTML Meta Tags
In HTML, meta tags provide metadata regarding the HTML document. Meta tag is located in the head of an HTML page.
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="This is a description of the web page">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="Your Name">
<title> Webpage </title>
</head>
<body>
<h2> Hello Coders! </h2>
<p> This is an example of meta tag </p>
</body>
</html>
Explanation of each meta tag:
- Character Encoding: It determines the character encoding of the HTML document. UTF-8 encoding is recommended for web pages.
- Viewport:
- Description: Gives a short description of the webpage which search engines often use in search results.
- Keywords: Identifies keywords that are pertinent to the content of the webpage.
- Author: Refers to the writer of the webpage.