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代码>到容器CSSvw
是一个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代码>到容器CSSvw
是一个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缓存。