LearnThatStack Ace your next interview
CSS3 · question
Question 12 of 110

Explain the viewport meta tag and its importance

beginner
← All CSS3 questions
Re-explain

The viewport meta tag tells a mobile browser how wide to lay out the page and how far to zoom. Without it, a phone lays the page out in a virtual viewport, usually 980px wide, then shrinks it to fit, so text renders tiny.

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  • width=device-width makes the layout viewport match the device's width in CSS pixels.
  • initial-scale=1.0 opens the page at normal zoom instead of zoomed out.
  • user-scalable=no blocks pinch zoom. Avoid it, because it stops people with low vision from enlarging the text.

Responsive CSS depends on this tag. Media queries test the layout viewport, so without it a phone matches the desktop breakpoints. On phones with a notch, adding viewport-fit=cover extends the page under it, and env(safe-area-inset-top) and its siblings pad content back into view.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the CSS3 cheatsheet.

← Back to all CSS3 questions
Pro · $10/mo

95 of 110 CSS3 answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime