根据屏幕的大小改变rem的参考值

it2022-05-05  101

移动端一半会选用rem+flex布局的方式,下面是根据屏幕的宽度,动态的改变rem的参考值     var screenWidth;             var html = document.getElementsByTagName("html")[0];             if (window.innerWidth) {                 screenWidth = window.innerWidth;             } else if ((document.body) && (document.body.clientWidth)) {                 screenWidth = document.body.clientWidth;             }             html.style.fontSize = 100 * screenWidth / 750 + "px";

转载于:https://www.cnblogs.com/songdongdong/p/6739715.html

相关资源:各显卡算力对照表!

最新回复(0)