Responsive Design: The Viewport Meta Tag

What is the Viewport?

The viewport is the visible area of a web page on a device. Mobile browsers render pages wider than the screen by default, causing a zoomed‑out view. The <meta name="viewport"> tag tells the browser how to control the page’s dimensions and scaling.

Basic Syntax

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

Common Attributes

Live Demo

Resize the browser window to see how the layout adapts. The box below uses the viewport settings to stay responsive.

Resize the window to see me adjust!

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6

Try Different Viewport Settings