移动端rem适配 flex.js

(function() {
document.addEventListener('DOMContentLoaded', function () {
var html = document.documentElement;
var windowWidth = html.clientWidth;
html.style.fontSize = windowWidth / 7.5 + 'px';
//等价于html.style.fontSize = windowWidth / 750 * 100 + 'px';
}, false);
})();

二倍图 750

猜你喜欢

转载自www.cnblogs.com/Mr-Rshare/p/9881787.html