<meta>: The META Element

Last updated: 2026-10-13

<meta>The META Element

Describes document metadata—charset, description, author, viewport—invisible on the page but vital for SEO and rendering.

CategoryMetadata
Content ModelFlow content
Allowed ParentsAny element that accepts flow content
Content TagSelf-closing — no closing tag needed
StatusStandard

📝 Syntax

<meta name="" content="">

⚙️ Attributes

This element supports the global attributes plus the following:

AttributeValueDescription
charsetDocument character encoding, e.g. UTF-8 (best placed first in head).
nameMetadata name, e.g. description, keywords, author, viewport.
contentThe value paired with name or http-equiv.
http-equivEmulates an HTTP response header, e.g. content-type, refresh.
propertySocial card property, e.g. og:title (Open Graph).

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<meta> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: meta is a void element; place charset early to avoid mojibake.

❓ FAQ

QWhat are the common categories of meta configuration?
ACharset <meta charset='UTF-8'>; viewport <meta name='viewport' content='width=device-width, initial-scale=1'>; SEO description name='description'; Open Graph sharing cards (og:title, og:image); robots index control (noindex/nofollow). Each category serves its own ecosystem.
QWhy must meta charset be within the first 1024 bytes?
ABrowsers parse as a stream and decode the first bytes with the default encoding before reading the charset declaration — if multi-byte characters appear earlier and the encoding guess is wrong, mojibake occurs and cannot self-recover. Hence charset must be head's first element.
QWhat parameters can the viewport content hold?
ACommon ones: width=device-width (follow device width), initial-scale=1 (initial zoom), maximum-scale/user-scalable (zoom limits — disabling zoom hurts accessibility, not recommended), viewport-fit=cover (notch-screen fit).
More case studies coming soon — check back later.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏