以最小1024尺寸为例:

function rem() {
    var htmlEle = document.documentElement;
    var winWidth = htmlEle.clientWidth || document.body.clientWidth;
    var width = winWidth <= 1024 ? 1024 : winWidth;
    htmlEle.style.fontSize = Math.ceil(100 * (width / 1920)) + 'px';
    htmlEle.style.height = htmlEle.clientHeight + 'px';
    htmlEle.style.minWidth = 1024 + 'px';
};
rem();
window.onresize = function() {
    rem();
}

 

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2022-02-10
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
相关资源
相似解决方案