HTML Tags
HTML <meta> Tag
The <meta> tag provides metadata about the HTML document, such as the character encoding, viewport settings, and page description.
What is the <meta> tag?
The <meta> element represents metadata that cannot be expressed by other head elements. It is a void element placed inside the <head>, and a page can contain many <meta> tags. Common uses include declaring the character set, controlling the mobile viewport, and providing an SEO description.
Common examples
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Find internships and entry-level jobs across India." />
<meta name="robots" content="index, follow" />
<meta http-equiv="refresh" content="30" />Complete example
<!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="A demo page describing meta tags." />
<title>Meta Tag Demo</title>
</head>
<body>
<p>Open your browser dev tools to inspect the meta tags.</p>
</body>
</html>Attributes
| Attribute | Description |
|---|---|
| charset | Declares the document's character encoding, almost always UTF-8. |
| name | The name of the metadata, e.g. description, viewport, robots, author. |
| content | The value associated with the name or http-equiv attribute. |
| http-equiv | Provides an HTTP header via the document, e.g. refresh or content-security-policy. |
| property | Used by protocols such as Open Graph (e.g. property="og:title"). |
💡
Always include <meta charset="UTF-8"> and the viewport meta tag. The charset declaration should appear within the first 1024 bytes of the document.
The <meta> tag is supported in all browsers. It never renders visible content on the page.
