主要使用了js控制

/**
 * @description: rem缩放
 */
(function () {
	
	
	
    updateOrientation();
    var supportOrientation = (typeof window.orientation === 'number' &&
        typeof window.onorientationchange === 'object');
    if (supportOrientation) {
        window.addEventListener('orientationchange', updateOrientationDelay, false);
    } else {
        window.addEventListener('resize', updateOrientationDelay, false);
    }

    function updateOrientation() {
        var deviceWidth = document.documentElement.clientWidth;
        if (deviceWidth > 750) deviceWidth = 750;
        document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';
    }

    function updateOrientationDelay() {
        setTimeout(function () {
            updateOrientation()
        }, 100);
    }
}());

再搭配一个reset.css

就可以顺利开始了 这里设计稿是750的,视真实情况而定。

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2021-05-05
  • 2021-07-09
  • 2022-12-23
相关资源
相似解决方案