How can I make my website automatically zoom out to 90%

15,303

Solution 1

If I understood you right. This should work:

<script type="text/javascript">
        function zoom() {
            document.body.style.zoom = "90%" 
        }
</script>

<body onload="zoom()">

To add zoom in Firefox read this object.Style.Zoom property not working in Firefox

Solution 2

Last answer will work for major browsers.

<script type="text/javascript">
    function zoom() {
        document.body.style.zoom = "90%" 
    }

This is the compatibility chart.

enter image description here

But as stated in THIS QUESTION

You could use the "proprietary" -moz-transform property in Firefox 3.5+.

So you could use:

div.zoomed { 
    zoom: 3; 
    -moz-transform: scale(3); 
    -moz-transform-origin: 0 0;
}

And there´s also a BUGZILLA ticket.

Bugzilla

Share:
15,303
willsf
Author by

willsf

Updated on June 04, 2022

Comments

  • willsf
    willsf almost 2 years

    I have a social netowork coded in PHP and css. Ive realized that it looks so much nicer and cleaner when its zoomed out at 90% instead of 100%. Is there a piece of code I can implement into the php or css to make the webpage automatically zoom out when its visited? This is mainly only for the login page.

    if you want to take a look at the site, heres the URL: social.flamboyantent.co.uk

    Thank you in advance.

  • willsf
    willsf over 9 years
    Thanks. It does work, but not with FireFox. How can I make this work on every browser?