window.onload=function(){
var deviceWidth = document.documentElement.clientWidth;
if(deviceWidth > 750) deviceWidth = 750;
document.documentElement.style.fontSize = deviceWidth / 7.5 + ‘px‘;
}
设计稿上面是14px的话,计算成0.14rem
原文:http://www.cnblogs.com/xfdmb/p/6018781.html