CSS px / logical px
Web layout uses CSS pixels. On the web, "logical pixel" usually means the same practical thing: a device-independent layout unit. Physical device pixels are roughly CSS pixels multiplied by DPR.
VitalsLog2 tool
Live CSS pixel, viewport, zoom, and mobile keyboard diagnostics.
Web layout uses CSS pixels. On the web, "logical pixel" usually means the same practical thing: a device-independent layout unit. Physical device pixels are roughly CSS pixels multiplied by DPR.
devicePixelRatio tells how many physical pixels sit
under one CSS pixel. A 390 CSS px wide phone at DPR 3 is about
1170 physical pixels wide.
The viewport CSS layout is built against. This is commonly
document.documentElement.clientWidth/Height. It may
stay stable when a virtual keyboard appears.
The visible part of the page after browser chrome, pinch zoom,
panning, and virtual keyboard effects. Read it from
window.visualViewport when supported.
When available, navigator.virtualKeyboard can expose
the keyboard bounding rectangle and optionally let the keyboard
overlay page content instead of resizing the visual viewport.
window.innerWidth/Height
{}