Automatic Refresh
A specified time will be mentioned in the meta tag after which the webpage will be automatically refreshed ie., this meta tag is used to specify a duration after which the web page will keep refreshing automatically after the given duration.
Example: The below code will refresh the web page after 8 sec.
<!DOCTYPE html>
<html>
<head>
<!-- meta tag starts -->
<meta name="keywords about"
content="Meta Tags, Metadata" />
<meta name="description"
content="Learning about Meta Tags." />
<meta name="revised about"
content="w3wiki" />
<meta http-equiv="refresh"
content="8" />
<!-- meta tag ends -->
</head>
<body>
<p>w3wiki!</p>
</body>
</html>
Output:
HTML Tag
The HTML <meta> tag defines metadata about an HTML document, including character set, description, keywords, author, and viewport settings. Placed within the <head> element, metadata aids browsers, search engines, and web services in interpreting and displaying content.
It helps in defining the page’s title, encoding, author, and viewport settings, etc. These tags are not visible on the web page but play a vital role in structuring and categorizing content for browsers and search engines.
Note: The meta tag also accepts Global Attributes in HTML.
Syntax:
<meta attribute-name="value">
Attributes:
Attribute Values | Description |
---|---|
This attribute is used to define the name of the property. | |
This attribute is used to get the HTTP response message header. | |
This attribute is used to specify properties value. | |
This attribute is used to specify a character encoding for an HTML file. | |
Determines a scheme to be utilized to decipher the value of the substance attribute. |
Example: Implementation of meta tag in the head tag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1,
maximum-scale=1">
<meta name="description" content="A Computer Science portal for geeks.
It contains well written, well thought
and well explained computer science and
programming articles, quizzes and practice/competitive
programming/company interview Questions.">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h2>w3wiki</h2>
<p>
This is an example of meta tag
</p>
</body>
</html>
Output:
There are various other ways to implement the <meta> tag that can use the following attribute values:
Table of Content
- Highlighting Important Keywords
- Providing a Description of the web page
- Document Revision Date
- Automatic Refresh
- Specifying Author of the Webpage