<script>
(function (doc, win) {
var docEle = doc.documentElement,
resizeEvent = 'orientationchange' in window ? 'orientationchange' : 'resize';
var recalCulate = function () {
var width = docEle.clientWidth;
docEle.style.fontSize = 100 * (width / 750) + 'px'; // 设计稿 750px
};
recalCulate();
if (!doc.addEventListener) return;
win.addEventListener(resizeEvent, recalCulate, false);
})(document, window);
</script>
eg. font-szie: 18px; 写成 font-size: 0.36rem;