// 调用函数
remFun();
// rem使用,适配计算
function remFun() {
//设置rem
document.documentElement.style.fontSize = innerWidth / 3.75 + “px”;
window.addEventListener(“resize”, function () {
document.documentElement.style.fontSize = innerWidth / 3.75 + “px”;
}, false)
};
自适应手机屏幕
最新推荐文章于 2020-06-12 16:44:53 发布