Good to know
CSS pixels and device pixels
A phone screen may have well over a thousand physical pixels across, but the browser groups them so text stays a comfortable size. The device pixel ratio (DPR) says how many physical pixels make up one CSS pixel in each direction:
device pixels = CSS pixels × device pixel ratio 390 × 844 at DPR 3 → 1170 × 2532 device pixels
That is why most phones report a viewport between roughly 360 and 430 pixels wide. Pictures look sharpest when they have about DPR times as many pixels as the space they fill.
What the lines mean
- Viewport (CSS px)
- The page area without scrollbars. Layout is based on this.
- Window inner size
- The same area including any scrollbar.
- Visual viewport
- The part you can actually see after pinch zoom, or while the on-screen keyboard is open.
- Screen and Available screen
- The whole display, and what is left after taskbars or docks, in CSS pixels.
- Colour scheme, Reduced motion, Contrast preference
- Your system settings, as websites see them through CSS media queries.
- Primary pointer and Hover
- Whether your main input is a finger (coarse) or a mouse or trackpad (fine), and whether it can hover.
Breakpoints
The breakpoint list tests (min-width: …) media queries from 360px to 1920px. Media queries measure the width including the scrollbar, so on a desktop with a visible scrollbar a breakpoint can match even when the viewport figure is a few pixels narrower.
Limits
- Browser zoom changes the size of a CSS pixel: at 200% zoom the viewport halves and the pixel ratio doubles.
- Some browsers round or limit what they report, to make tracking harder, so screen figures can be approximate.
- The page can only see what the browser reports. It cannot tell the make or model of your device.