<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //根据基准屏幕宽度等比例缩放页面(适配不同设备宽度)
        (function () {
            var targetW = 1280
            var vpWidth = document.documentElement.clientHeight
            var scale = vpWidth / targetW
            document.querySelector("meta[name=viewport]").content = "initial-scale=" + scale
        })
    </script>
</head>
<body>
</body>
</html>
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/tech/webdev/272744.html
