The HTML Tag: meta is an important tag in HTML that is used to provide metadata about an HTML document. Metadata is data that describes other data, and in the case of HTML, it provides information about the HTML document itself. This information is not displayed on the web page, but is used by search engines, browsers, and other applications to understand and process the content of the page.
The HTML Tag: meta is used to provide information about the HTML document, such as the author, keywords, description, and character set. The meta tag is placed in the head section of the HTML document, and is not visible to the user. The meta tag is used by search engines to index the page, and by browsers to display information about the page in the address bar and search results.
The meta tag has several attributes that can be used to provide different types of information about the HTML document. The most commonly used attributes are:
name
: Specifies the type of metadata being provided.content
: Specifies the value of the metadata.For example, the following code provides information about the author and description of the HTML document:
<meta name="author" content="John Doe"> <meta name="description" content="This is a sample HTML document">
The following code specifies the character set of the HTML document:
<meta charset="UTF-8">
The meta tag can also be used to specify keywords that are relevant to the content of the HTML document. However, this attribute is no longer used by most search engines, as they now rely on the content of the page to determine its relevance.
Here are some examples of how the HTML Tag: meta can be used:
<meta charset="UTF-8">
<meta name="author" content="John Doe"> <meta name="description" content="This is a sample HTML document">
<meta name="keywords" content="HTML, meta, tags">
<meta http-equiv="refresh" content="5;url=http://www.example.com">
In this example, the page will automatically redirect to http://www.example.com after 5 seconds.