1.

window.onload = function () {
getRem( 750, 100 )
};
window.onresize = function () {
getRem( 750, 100 )
};
function getRem( pwidth, prem ) {
var html = document.getElementsByTagName( "html" )[0];
var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
html.style.fontSize = oWidth / pwidth * prem + "px";
}

750屏幕宽,7.5rem相当于750px, 设计稿同比缩放

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-08-24
  • 2021-09-28
  • 2022-02-09
相关资源
相似解决方案