CSS - Scale (Zoom Factor)

About

Scale is the zoom level of a page is first loaded.

When the zooming factor is exactly 100%, one CSS pixel equals one device pixel.

Management

Default

The scale when the page is loaded is defined by the viewport meta tag

Maximum, minimum

The maximum-scale, minimum-scale, and user-scalable properties are defined by the viewport meta tag

Calculation

You can calculate that factor by dividing screen.width by window.innerWidth

onResize = function () {
     zoomFactor=window.innerWidth/screen.width; 
     console.log("The Zooming factor is "+zoomFactor);
}
onResize();

window.onresize = function () {
     zoomFactor=window.innerWidth/screen.width; 
     console.log("The Zooming factor is "+zoomFactor);
}





Discover More
CSS - Viewport (Reader's window)

The viewport is the viewing area on a screen media. It's then a property of media. The top media of a browser is the window (ie browser tab) As an iframe create a new window, you can set a new viewport...



Share this page:
Follow us:
Task Runner