Skip to content
BENIBIX Learn

Viewport

Design🌐 Web DesignResponsive Layout

Also known as Browser Viewport, Visible Area

The part of a web page you can see on the screen right now.

Think of it like

It is like a window in a wall. You only see the part of the garden the window shows.

Example

Jack opens a site with no viewport tag on his phone. The page is tiny, and he has to pinch to read it.

Why it matters

Each layout that fits the screen needs it. Without the tag, phones skip the breakpoints.

Definition

The viewport is the part of a web page you can see on the screen right now. On a phone it is small and tall; on a desktop it is wide. A phone needs one line of HTML, the viewport meta tag, to show a page at its real width. Without it, the phone shows a tiny zoomed-out desktop page.

Example code

html
<meta name="viewport" content="width=device-width, initial-scale=1">
This line tells a phone to lay out the page at the phone's own width.

Common mistake

Blocking zoom with maximum-scale=1. People who need bigger text can no longer zoom in.

Key takeaways

  1. 1
    What you see now. The visible area.
  2. 2
    One line of HTML. The viewport tag.
  3. 3
    Never block zoom. Let people pinch.

Compare