Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 移动设备上的全宽容器_Android_Html_Css_Mobile - Fatal编程技术网

Android 移动设备上的全宽容器

Android 移动设备上的全宽容器,android,html,css,mobile,Android,Html,Css,Mobile,伙计们! 我有一个带有以下代码的网站: <html> <head> <!-- some code here --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div class="screenFourth">

伙计们! 我有一个带有以下代码的网站:

<html>
    <head>
        <!-- some code here -->
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div class="screenFourth">
            <div class="container">
                <!-- a lot of tags -->
            </div>
        </div>
    </body>
</html>
我怎样才能解决这个问题?谢谢大家!

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

.screenFourth{
    background-image: url(...);
    background-size: cover;
    background-position: top;
    width: 100%;
    min-height: 1380px;
}

@media screen and (max-width: 760px){
    .container{ width: 100vw; margin: 0; padding: 0; }
}
将以下内容添加到CSS文件中。我已将背景宽度设置为100%, 并增加
宽度:100vw到容器CSS
vw
是一个css单元,用于设置相对于视图端口的宽度。我希望这有帮助

还从HTML和Body标记中去掉了边距和填充

编辑HTML

<html>
    <head>
        <!-- some code here -->
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0">
    </head>
    <body>
        <div class="screenFourth">
            <div class="container">
                <!-- a lot of tags -->
            </div>
        </div>
    </body>
</html>

将以下内容添加到CSS文件中。我已将背景宽度设置为100%, 并增加
宽度:100vw到容器CSS
vw
是一个css单元,用于设置相对于视图端口的宽度。我希望这有帮助

还从HTML和Body标记中去掉了边距和填充

编辑HTML

<html>
    <head>
        <!-- some code here -->
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0">
    </head>
    <body>
        <div class="screenFourth">
            <div class="container">
                <!-- a lot of tags -->
            </div>
        </div>
    </body>
</html>


.screenFourth:100vw;你能发布图片的url吗?@VladoPandžić点击“右侧空白”链接。@Gerard它保持不变..screenFourth:100vw;你能发布图片的url吗?@VladoPandžić点击“右侧空白”链接。@Gerard它保持不变。对不起,但还是一样。没什么变化。@Tohh对不起,我刚刚编辑了答案,你能再检查一下吗谢谢,但我什么也没做,不知怎么的,它起了作用。也许是因为Chrome缓存。对不起,但它还是一样的。没什么变化。@Tohh对不起,我刚刚编辑了答案,你能再检查一下吗谢谢,但我什么也没做,不知怎么的,它起了作用。可能是因为Chrome缓存。