CSS - Scale (Zoom Factor)

> (World Wide) Web - (W3|WWW) > CSS - Cascading Style Sheets - Markup Language (HTML|XML) Skin

1 - 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.

Advertising

3 - Management

3.1 - Default

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

3.2 - Maximum, minimum

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

3.3 - 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);
}

web/css/scale.txt · Last modified: 2019/02/09 11:40 by gerardnico