1. 程式人生 > >Rem佈局設定

Rem佈局設定

 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" id="vp"/>
      <script>
        var wd = document.documentElement.clientWidth*window.devicePixelRatio/10;
        document.getElementsByTagName("html")[0].style.fontSize = wd + "px";
        var scale = 1/window.devicePixelRatio;
        var mstr = 'initial-scale='+ scale +', maximum-scale='+ scale +', minimum-scale='+ scale +', user-scalable=no';
        document.getElementById("vp").content = mstr;
      </script>