I am trying to set the zoom of a website to 100%. I understand that firefox doesn't support this but I am trying to get it to work in chrome.
I've set the zoom:
body {
padding-top: 0px;
padding-bottom: 20px;
zoom: 100%;
}
And chrome appears to be seeing the css take effect:
But when I increase the zoom and refresh it does not get set back to 100%:
What am I doing wrong and how do I fix it? CSS/HTML/jQuery answers are all fine.
Edit: it looks like the best approach so far is to simuate a ctrl+0 keypress on load. I have figured out how to generate it but how do you trigger it without any user input?
var press = jQuery.Event("keypress");
press.ctrlKey = true;
press.which = 48;
// trigger press
You, the author of the webpage, have no power (or should have no power) over the user's browser configuration. The browser's zoom feature is an accessibility feature; many users rely on it to make text readable. As the developer/designer, do your best to accommodate a 125% scale.
Firefox does not support the zoom
property, as it is (and has always been) non-standard. It only served to scale the content of a webpage, and isn't meant to control the actual browser's settings.
See https://css-tricks.com/almanac/properties/z/zoom/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With