移动端一半会选用rem+flex布局的方式,下面是根据屏幕的宽度,动态的改变rem的参考值
    var screenWidth;
            var html = document.getElementsByTagName("html")[0];
            if (window.innerWidth) {
                screenWidth = window.innerWidth;
            } else if ((document.body) && (document.body.clientWidth)) {
                screenWidth = document.body.clientWidth;
            }
            html.style.fontSize = 100 * screenWidth / 750 + "px";

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-08-02
  • 2021-12-25
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案