<meta> Tag in HTML

The <meta> tag in HTML is used to provide metadata about an HTML document. Metadata is information about the document that is not displayed on the page itself but is used by browsers and search engines. The <meta> tag is placed inside the <head> section of the document.

Key Points on <meta> Tag:

Syntax of <meta> Tag:

Syntax Example

<meta name="name" content="value">

Example of <meta> Tag in HTML:

This example demonstrates how the <meta> tag can be used to define metadata such as the description and keywords for a web page.

Code Example

<head>
            <meta charset="UTF-8">
            <meta name="author" content="John Doe">
            <meta name="description" content="A sample webpage for learning HTML">
            <meta name="keywords" content="HTML, Meta tag, Example">
            <meta name="viewport" content="width=device-width, initial-scale=1">
        </head>

Output

The content in the <meta> tags will not be visible on the page but will affect the document's metadata and behavior in the browser and search engines.

Attributes of <meta> Tag:

The <meta> tag plays a crucial role in search engine optimization (SEO) by defining the page's metadata, which can influence how search engines rank the page. It's also important for controlling page behavior and appearance on different devices, especially with the viewport attribute. The <meta> tag is essential for web development, aiding in SEO optimization, defining responsive design properties, and specifying document encoding.