750px 等于 7.5rem

<script>
!function (n) {
    var e = n.document,
    t = e.documentElement,
    i = 750,
    d = i / 100,
    o = "orientationchange" in n ? "orientationchange" : "resize",
    a = function () {
        var n = t.clientWidth || 320;
        n > 750 && (n = 750);
        t.style.fontSize = n / d + "px"
    };
    e.addEventListener && (n.addEventListener(o, a, !1), e.addEventListener("DOMContentLoaded", a, !1))
}(window);
</script>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
}
 
.fl {
float: left;
}
 
.fr {
float: right;
}
 
.pr {
position: relative;
}
 
.clear {
clear: both;
}
 
.cf {
zoom: 1;
}
 
.cf::after {
display: block;
height: 0;
clear: both;
font-size: 0;
content: '.';
visibility: hidden;
}
</style>
原文地址:https://www.cnblogs.com/dreammiao/p/15474078.html