响应式js设置

<script>
(function anonymous() {
// 声明一个函数,并直接的执行
function computed() {
let HTML = document.documentElement, winW = HTML.clientWidth, desW = 750;
if (winW > desW) {
HTML.style.fontSize = "100px";
return;
}
HTML.style.fontSize = winW / 750 * 100 + "px";
}
computed();
window.addEventListener('resize', computed, false);
})();
</script>
原文地址:https://www.cnblogs.com/leigepython/p/9468703.html