Zoom the default page

0

There is a script that when the user opens the system, the zoom is already pre-configured when the page is already set.

    
asked by anonymous 11.06.2018 / 22:45

2 answers

2

The meta-tag: <meta name="viewport" content="width=device-width, initial-scale=2.0"> is not for all environments and on the desktop maybe this will not work.

The zoom: ...; property is not standard and pro is not supported by all browsers, so it runs in all current browsers, prefer transform , like this:

#content {
    transform: scale(2.0);
    transform-origin: 0 0;
}

html:

<body>
<div id="content">
... conteudo da sua página ...
</div>
</body>

Do not apply directly to the body, this can affect some scrollbars.

If you need support for older browsers use:

#content {
    /*Safari e Chrome antigos*/
    -webkit-transform: scale(2.0);
    -webkit-transform-origin: 0 0;

    /*Firefox mais antigo*/
    -moz-transform: scale(2.0);
    -moz-transform-origin: 0 0;

    /*IE 9*/
    -ms-transform: scale(2.0);
    -ms-transform-origin: 0 0;

    /*navegadores atualizados*/
    transform: scale(2.0);
    transform-origin: 0 0;
}
    
11.06.2018 / 23:02
3

Yes, and you do not even need JS. Using HTML5:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

The initial-scale controls the initial zoom of the page. 1.0 is 100%, 0.75 is 75%, and so on. Another option is to use the zoom property of the CSS.

body {
    zoom: 2 /* Coloca o zoom em 200% */
}
    
11.06.2018 / 22:51