FrontendBeginner
Viewport
PronunciationVYOO-port
Definition
The visible part of a web page inside the browser or on a phone screen. Layouts and media queries respond to its width, so it decides what the user actually sees.
Where you hear it
CSS (vw, vh), media queries, and mobile testing.
Examples
The menu should collapse when the viewport is narrower than 600px.
Add the viewport meta tag, or the page will look tiny on phones.
The page adapts to the viewport width, so the text stays readable on a phone.
Common mistake
Confusing the viewport with the full page. The page can be much taller than the viewport.
Don't confuse with
Viewport refers to the visible area of the browser window, while screen refers to the physical dimensions of the monitor or mobile device.
Say it at work
- In a meeting or chat
Let us test this component across different viewport sizes to ensure the layout does not break.
- In an email or ticket
Please update the media query so it triggers when the viewport width drops below 768px.