Metadata Names
HTML meta name="viewport"
Configures the layout viewport for responsive pages, particularly on mobile. Do not prevent zoom using restrictive scale settings; use responsive CSS for the layout itself. Place this metadata in the document head. Its consumer depends on the name: some values are browser settings, others are crawler or application metadata.
Formal Syntax & Structure
html syntaxhtml
<meta name="viewport" content="width=device-width, initial-scale=1">Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | keyword | Use viewport. |
| content | name-specific text or tokens | Example value: width=device-width, initial-scale=1. Interpret according to the metadata name. |
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <p>Example document</p> </body></html>