1rem=100px

document.documentElement.style.fontSize = innerWidth / 7.5 + 'px';
    window.onresize = function () {
      document.documentElement.style.fontSize = innerWidth / 7.5 + 'px';
    }
原文地址:https://www.cnblogs.com/zhanghailing/p/12021517.html