大屏自适应中的rem设置

rem() {

  document.querySelector("html").style.fontSize = (1280 / 1920) * 16 + "px";

  window.addEventListener("resize", function () {
  document.querySelector("html").style.fontSize =
    (1280 / 1920) * 16 + "px";
  });

},

posted @ 2022-01-08 16:40  lililililililili  阅读(42)  评论(1)    收藏  举报