rem 布局代码

根据设计稿的高度,除以相对应的数字

<script type="text/javascript">
// 把尺寸放大N倍(N是window.devicePixelRatio)
var wd = document.documentElement.clientWidth*window.devicePixelRatio/7.5;
document.getElementsByTagName("html")[0].style.fontSize = wd + "px";
</script>

原文地址:https://www.cnblogs.com/liyouwu/p/9717442.html