html {
font-size: 1.02865px;
}
@media screen and (max-width: 767px) {
html {
font-size: 0.833333px;
}
}
const handleResize = () => {
console.log("重置rem");
const hw = document.documentElement.clientWidth || document.body.clientWidth;
let htmlDom = document.getElementsByTagName("html")[0];
if (hw < 768) htmlDom.style.fontSize = hw / 450 + "px";
else if (hw < 1700) htmlDom.style.fontSize = hw / 1000 + "px";
else htmlDom.style.fontSize = hw / 1850 + "px";
};
handleResize();
window.onresize = handleResize;