Meta tags are used in HTML documents to provide structured metadata about a webpage. They are invisible to visitors but readable and useful for browsers, search engines, and other web services. Here is how to use them:
Step 1: Open a New Document
Create a new HTML document using a text editor. This will be your webpage where you want to insert meta tags.
Step 2: The head area
All meta tags should be placed inside the `
` element of the HTML document.Step 3: Insert Meta Tag
The basic structure of meta tag is shown below:
```
```
Both `name` and `content` are attributes of the `meta` tag. The `name` attribute is the name of the metadata and the `content` attribute is the value of the metadata.
Here are some examples of widely-used meta tags:
1. Description Meta Tag: This tag is used to describe the webpage.
```
```
1. Keywords Meta Tag: This tag is used to tell search engines what the topic of the webpage is.
```
```
1. Charset Meta Tag: This tag is used to specify the character encoding for the HTML document.
```
```
Please note that not all meta tags have a `name` attribute. Some, like the charset meta tag, use other attributes.
1. Viewport Meta Tag: This is used to control the viewport (the user’s visible area of a web page), especially on a mobile device. It ensures your page is displayed correctly on different devices.
```
```
1. Author Meta Tag: This tag is used to state the author of the webpage.
```
```
Step 4: Save the Document
After inserting the necessary meta tags, save the HTML document and upload it to your website server.
Remember, not all meta tags are recognized by all browsers or search engines. Google, for example, no longer uses the “keywords” meta tag in web ranking.