Blogzlj
 1 function fnInitScreen() {
 2     var html = document.getElementsByTagName("html")[0];
 3     var width = window.innerWidth;
 4     var font_size = 0;
 5     font_size = 100/1500*width;   //100 设计稿单位计算的分母(400/100)=4rem    1500 设计图比例
 6     html.style.fontSize = font_size + "px";
 7 }
 8 fnInitScreen();
 9 window.onresize = function () {
10     fnInitScreen();
11 }

 

分类:

技术点:

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-09-06
  • 2021-12-06
  • 2022-01-02
  • 2021-11-01
相关资源
相似解决方案