0
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>

<style>
    body{  background-image: linear-gradient(#0e142c, #141f3d);  }

    html,body,#main{  min-height: 100%;  }
</style>

<div id="main"></div>
<script>
    initViewport();
    function initViewport(){
        var idaelViewport = window.screen ? window.screen.width: $(window).width();
        var visualViewport = 375;
        var zoomView = idaelViewport / visualViewport;
        $('meta[name="viewport"]').attr("content",
                "user-scalable=no,width=" + visualViewport + ",initial-scale=" + zoomView + ", minimum-scale=" + zoomView + ", maximum-scale=" + zoomView + ",viewport-fit=cover"
        );
    };

</script>

</body>
</html>

如上代码 为什么给body 加渐变色 或者添加背景图片时 ios plus 底部会有一条白色的线 安卓的没有 要怎么解决

1个回答

0

你用的什么浏览器?我QQ浏览器和微信都没复现

撰写答案

Planets