The <meta> tag
The <meta> tag defines document metadata: charset, description, viewport, Open Graph tags, and more. It lives in <head>.
Syntax
<meta name="description" content="Page description"> Attributes
| charset | Document encoding, usually <meta charset="UTF-8"> — should be the first thing in head. |
| name + content | A pair for standard metadata: description, viewport, robots, etc. |
| property + content | The Open Graph format (not part of the HTML spec, but widely supported): og:title, og:description, og:image. |
| http-equiv | Emulates an HTTP header, e.g. refresh or Content-Security-Policy (limited support via meta). |
Example
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A short page description for search engines">
<meta property="og:title" content="Title for social sharing">
Notes
- meta is a void element — no closing tag needed.
- Without a viewport meta tag, mobile browsers render the page scaled as a desktop layout.