What meta tags do
<meta> elements in the document <head> carry metadata that never renders
but steers the browser, search crawlers and social platforms. They come in
three families by attribute: name (HTML-standard metadata), property
(Open Graph), and http-equiv (HTTP-header-like directives). This reference
lists the common values in each, with the exact markup, what each does, and
whether it targets the browser, SEO or social previews.
How it works
Each tag pairs a key attribute with a content value:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A 150–160 character summary.">
<meta name="robots" content="index, follow">
<meta property="og:title" content="Page title for sharing">
<meta property="og:image" content="https://example.com/card.png">
<meta name="twitter:card" content="summary_large_image">
<meta http-equiv="content-security-policy" content="default-src 'self'">
charset must come first (within the first 1024 bytes). name and property
declare document-level facts; http-equiv simulates a response header when one
cannot be set server-side.
Tips and notes
- Put
<meta charset="utf-8">andviewportfirst; everything else follows. descriptionhas no direct ranking weight but is the snippet text crawlers often show, so write it for clicks (~150–160 chars).- Open Graph uses
property=og:*; Twitter cards usename=twitter:*— don’t mix the attribute up or platforms ignore the tag. - Prefer real HTTP headers over
http-equivfor security (CSP, X-Frame-Options) when you control the server. theme-colortints mobile browser UI; pair it with a media query for dark mode.