移动端适配
// 适配100倍 1rem = 100px fnResize(); window.onresize = function() { fnResize(); window.addEventListener("resize", fnResize); }; function fnResize() { let devWidth = document.documentElement.clientWidth || window.innerWidth; if (devWidth >= 750) { devWidth = 750; } if (devWidth <= 320) { devWidth = 320; } document.documentElement.style.fontSize = devWidth / 3.75 + "px"; }
375设计稿,用的3.75