How to zoom in a page in css or javascript?

0

Would you like to know how do I start the site with 67% zoom in CSS or JavaScript?

    
asked by anonymous 22.03.2016 / 21:16

3 answers

2

If it is in CSS you have the following properties:

  • zoom:

    body {
        zoom: 67%;
    }
    
  • transform:

    body {
         transform: scale(0.67); /*0.67 equivale ao 67%*/
    }
    

Note that if you are developing a mobile page and this is your problem then the problem may be best resolved with <meta name="viewport"> .

In this way you deactivate the automatic zoom of the mobiles and deactivate the scale with the touch:

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=.67, maximum-scale=1.0, user-scalable=0">

If you want to set a default scale do so ( .67 equals 67%):

<meta name="viewport" content="width=device-width, initial-scale=.67, minimum-scale=.67, maximum-scale=.67, user-scalable=0">

If you want to enable the scale do this user-scalable=1 or remove the user-scalable=1

    
22.03.2016 / 21:27
0

This should resolve:

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


<body onload="ajustaZoom()">
</body>
    
22.03.2016 / 21:24
0

Try this:

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

<body onload="zoom()">
    <h6>content</h6>
</body>
    
22.03.2016 / 21:24