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

NameTypeDescription
namekeywordUse viewport.
contentname-specific text or tokensExample 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>
HTML Reference