The Viewport

Viewport setting for <meta>

The viewport setting of ``` is used to control the visual size of a web page.

<meta name="viewport" content="initial-scale=1" />

This means that the page is not scaled up or down for initial loading.

The following code specifies the width of the viewport to which the page is adapted.

<meta name="viewport" content="width=320" />

The following code specifies the width of the web page as the device width.

<meta name="viewport" content="width=device-width" />

The following code specifies that the user cannot zoom in on the page.

<meta name="viewport" content="maximum-scale-1" />

The web page for cell phones is usually written as follows.

<meta name="viewport" content="width=device-width, initial-scale=1" />