Tsallaka zuwa abun ciki
Justice Tech School

The Viewport Meta Tag

Without the viewport tag, phones pretend to be wide screens and shrink your page. Add <meta name="viewport" content="width=device-width, initial-scale=1"> to the head of every page.

It tells the browser to use the real width of the device, which is the first step of responsive design.

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

Exercise

Use the real device width.

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

Quiz Test

What happens if you forget the viewport tag?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.