Viewport
The visible area of a page.
See it on the 3D treeGoing deeper
It is the window onto the page, usually smaller than the whole document, and changes with resizing, rotation, zoom and sometimes on-screen keyboards or collapsing browser bars. Mobile browsers need a viewport meta setting to match layout width to the device. CSS offers units based on viewport dimensions.
Why it matters
You avoid assuming a fixed screen and plan for content that sits below the visible area or behind browser controls.
In practice
A full-height hero hides its button behind a phone's browser toolbar, so you switch to a safer height and test again.
Common mistake
Disabling zoom in the viewport settings, which can stop people with low vision enlarging content.
Connected terms
- Adaptive DesignThe visible size is one input for choosing a layout.
- BreakpointWidth breakpoints usually respond to the size of the viewport.
- Media QueryQueries test viewport features to decide which styles apply.
- Responsive DesignLayouts adapt as the viewport's size and orientation change.
- Safe AreaScreen safe areas affect how content fits within the visible viewport.