rem 响应式布局 设置
css 中给html 设置100px字体大小;
在js中设置这样:
(function(window) {
let computedREM = function computedREM() {
let winW = document.documentElement.clientWidth,
desW = 640;
if (winW >= desW) {
document.documentElement.style.fontSize = '100px';
return;
}
document.documentElement.style.fontSize = winW / desW * 100 + 'px';
};
computedREM();
window.addEventListener('resize', computedREM);
})(window);

浙公网安备 33010602011771号