2

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
  • 41
  • 1
  • 1
  • 3
  • possible duplicate of [How to Increase browser zoom level on page load?](http://stackoverflow.com/questions/9441557/how-to-increase-browser-zoom-level-on-page-load) – Scott Solmer Dec 21 '14 at 18:51
  • You can use the transform property, for inspiration and help see: http://css3generator.com – Legarndary Dec 21 '14 at 19:17

2 Answers2

4

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

Community
  • 1
  • 1
igor
  • 716
  • 1
  • 9
  • 27
3

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

Cesar Cisneros
  • 65
  • 1
  • 2
  • 9