bklLiudl
2024-07-12 a541742fd68adfd5d4a77d1f7f0fc69045c72ac2
1
2
3
4
5
6
7
8
9
10
(function () {
    var html = document.documentElement;
    function onWindowResize() {
        html.style.fontSize = html.getBoundingClientRect().width / 15 + 'px';
    }
    // 750/15=50   1rem=25px
    // 640/16=40   1rem=20px
    window.addEventListener('resize', onWindowResize);
    onWindowResize();
})();