<meta name="viewport" content="width=device-width, initial-scale=1"> Enables a normal responsive layout on phones.
How It Works
Set name="viewport" for viewport metadata.
width=device-width matches CSS pixels to the device width.
initial-scale=1 starts at 100% zoom.
Without it, many phones shrink a “desktop-width” page and force pinch-zoom.
Example 3 — Meta Description
Provide a short summary search engines may show under your title.
HTML
<head>
<meta charset="utf-8">
<title>HTML meta Tag | CodeToFun</title>
<meta
name="description"
content="Learn HTML meta tags: charset, viewport, and description."
>
</head>
Learn HTML meta tags: charset, viewport, and description.
How It Works
Use name="description" with a concise content summary.
Keep it accurate — engines may ignore or rewrite poor snippets.
Pair with a clear <title> for the result headline.
It is not a ranking switch — it mainly influences how the result can look.
Edge Cases & Pitfalls
Most meta mistakes are placement, outdated SEO myths, or harmful redirects.
placement
Keep meta in <head>
Document metadata belongs with <head>. Put charset first among meta tags.
keywords
keywords is mostly ignored
Major search engines do not use meta keywords for ranking. Focus on real content and a good description.
a11y
Skip timed refresh redirects
http-equiv="refresh" can move users without consent. Prefer HTTP redirects or explicit links.
modes
One job per meta element
Use either charset, or name+content, or http-equiv+content — not conflicting combinations.
viewport
Do not disable zoom casually
Avoid locking user-scalable=no / extreme maximum-scale — it hurts accessibility.
Compatibility
Browser Support
The <meta> element is Baseline · Widely available. Charset, viewport, and description are broadly supported; some named metadata values vary by browser.
✓ Baseline · Widely available
<meta>
Supported in modern Chrome, Firefox, Safari, Edge, and Opera. Metadata is not rendered as visible page content.
100%Modern browser coverage
Google ChromeYes
Supported
Mozilla FirefoxYes
Supported
Apple SafariYes
Supported
Microsoft EdgeYes
Supported
OperaYes
Supported
Internet ExplorerYes · EOL
Supported
<meta>Widely available
Bottom line: Every HTML page should include charset and a viewport meta tag; add description when you want a clear search snippet.
Avoid: refresh redirects and relying on meta keywords for SEO.
One line: Start every page with UTF-8 + viewport meta, then add accurate descriptions when needed.
UA style
Default CSS Settings
meta is metadata — not rendered as visible content. User agents typically treat it as:
default.css
meta {
display: none;
}
You do not style meta for layout. Effects come from how browsers and crawlers read the attributes.
Frequently Asked Questions
The meta element provides document metadata that other head elements cannot express — character encoding, viewport hints, descriptions, and name/content pairs for browsers and crawlers.
Put meta inside the head. Place charset as early as possible (within the first 1024 bytes). Viewport and description also belong in head.
HTML5 documents must use UTF-8. Use <meta charset="utf-8">. Other encodings are not valid for HTML documents.
name="viewport" with a content value like width=device-width, initial-scale=1 tells mobile browsers how to size the layout viewport for responsive pages.
It does not directly rank pages, but search engines often use it as the snippet under your title. Write a clear, accurate summary.
Avoid it. Timed redirects hurt accessibility and usability. Prefer an HTTP redirect from the server, or a normal link users choose.