Nov 10, 2018

meta viewport

Pages optimized for a variety of devices must include a meta viewport element in the head of the document. A meta viewport tag gives the browser instructions on how to control the page's dimensions and scaling.

In web browsers, the viewport is the visible portion of the entire document. If the document is larger than the viewport, the user can shift the viewport around by scrolling.

<meta name="viewport" content="width=device-width, initial-scale=1">
Using the meta viewport value width=device-width instructs the page to match the screen’s width in device independent pixels. This allows the page to reflow content to match different screen sizes, whether rendered on a small mobile phone or a large desktop monitor.