Open better2021 opened 4 years ago
// 在iphone6/7/8/x下,1rem=50px (function () { SetRem(); window.addEventListener('resize', SetRem); function SetRem() { var html = document.documentElement; var hWidth = html.getBoundingClientRect().width; fz = hWidth / 7.5; html.style.fontSize = fz <= 100 ? fz + 'px' : '100px'; } })();
rem.js rem单位转px单位