<script TYPE="text/javascript">
var docEl = document.documentElement;
function setRemUnit () {
var rem = docEl.clientWidth / 19.2; // 可根据不同电脑分辨率进行手动修改(如1920*1080 为19.2
docEl.style.fontSize = rem + 'px'
}
setRemUnit()
window.addEventListener('resize', setRemUnit)
window.addEventListener('pageshow', function (e) {
if (e.persisted) {
setRemUnit()
}
})
</script>
标签:19.2,适应,docEl,屏幕,font,setRemUnit,size
From: https://www.cnblogs.com/respect-li/p/17139651.html