(function(){ var deviceWidth = document.documentElement.clientWidth; //设备像素宽度 if(deviceWidth > 640){ deviceWidth = 640; } document.documentElement.style.fontSize = deviceWidth*2 / 7.5 + ‘px‘; })();
原文:https://www.cnblogs.com/boomupupup/p/9674602.html