let $html=document.documentElement,windowW = window.innerWidth,ratio = windowW / 750if (windowW > 750) { $html.style.fontSize='100px'} else { $html.style.fontSize=100 * ratio + "px"}常规的移动端ui出图都是以iphone6的尺寸来设计,上面设置好根字体后直接就可以拿设计稿上的尺寸用了。比如:25px就写0.25rem即可,不同尺寸的移动设备就会自动匹配啦!
转载于:https://www.cnblogs.com/neol/p/7515086.html
相关资源:3分钟读懂移动端rem使用方法(推荐)