HTML – Meta Tags
Meta tags are HTML elements that provide information about a webpage to search engines and web browsers. They are placed within the <head>
section of an HTML document. Here are some examples of commonly used meta tags:
Title Tag: Specifies the title of the webpage. It is displayed in the title bar of a browser and as the main headline in search engine results.
1 2 3 4 |
<head> <title>My Webpage Title</title> </head> |
Description Tag: Provides a brief description of the webpage’s content. It is often displayed as a snippet in search engine results.
1 2 3 4 |
<head> <meta name="description" content="This is a brief description of my webpage."> </head> |
Keywords Tag: Specifies a list of keywords or phrases that are relevant to the webpage’s content. However, search engines nowadays typically don’t rely heavily on this tag for ranking purposes.
1 2 3 4 |
<head> <meta name="keywords" content="keyword1, keyword2, keyword3"> </head> |
Viewport Tag: Controls the width and scaling of the webpage on different devices, especially mobile devices.
1 2 3 4 |
<head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> |
Charset Tag: Declares the character encoding for the webpage. It ensures that the browser displays the text correctly.
1 2 3 4 |
<head> <meta charset="UTF-8"> </head> |
Author Tag: Specifies the author of the webpage.
1 2 3 4 |
<head> <meta name="author" content="John Doe"> </head> |
Robots Tag: Instructs search engine crawlers on how to behave when indexing the webpage. It can control whether the page should be indexed, followed, or if certain content should be excluded from indexing.
1 2 3 4 |
<head> <meta name="robots" content="index, follow"> </head> |