1-1 移动端视配
    将屏幕等分成10等分,相当于10个rem单位

    1. //https://m.1905.com/ 参考网站
    2. <script>
    3. let w = window.innerWidth;
    4. let html = document.getElementsByTagName("html")[0];
    5. html.style.fontSize = w*0.1+"px";
    6. window.onresize = function(){
    7. let w = document.documentElement.clientWidth;
    8. console.log(w);
    9. html.style.fontSize = w*0.1+"px";
    10. }
    11. </script>