HTML meta Tag | Character Set Encoding - Viewport Settings - Page Description - Author Information - Keywords - Example of HTML meta Tag

HTML <meta> Tag:

The `<meta>` tag in HTML is used to provide metadata about the HTML document. Metadata is information about the data contained in the document, and it is not displayed on the web page itself. Instead, it provides information such as character set encoding, viewport settings for responsive design, and other details that browsers and search engines may use.

Here are some common uses of the `<meta>` tag:

Character Set Encoding:

Specifies the character encoding for the document. It helps browsers interpret the text correctly.

html
<meta charset="UTF-8">

Character Set Encoding - Viewport Settings - Page Description - Author Information - Keywords - Example of HTML meta Tag
HTML meta Tag

Viewport Settings:

Used for responsive web design to control the viewport's behavior on different devices.

html
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Page Description (for Search Engines):

Provides a brief description of the document's content for search engines.

html
<meta name="description" content="A brief description of the page content.">

Author Information:

Specifies the author of the document.

html
<meta name="author" content="John Doe"

Keywords (for Search Engines):

Specifies keywords related to the document's content for search engines.

html
<meta name="keywords" content="HTML, CSS, JavaScript">

Refresh Meta Tag:

Automatically refreshes or redirects the page after a specified time.

html
<meta http-equiv="refresh" content="5;url=https://example.com">

Example of HTML meta Tag:

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="An example HTML document with meta tags">
  <meta name="author" content="Your Name">
  <meta name="keywords" content="HTML, CSS, meta tags">
  <title>HTML Meta Tag Example</title>
</head>
<body>
  <!-- Content of the HTML document goes here -->
</body>
</html>

In this example, the `<meta>` tags are used to specify the character set, viewport settings, page description, author information, and keywords for the HTML document. These metadata elements contribute to the proper rendering and indexing of the webpage by browsers and search engines.
ShowHideComments