【发布时间】:2015-11-17 21:09:01
【问题描述】:
在我的网站 (www.wetter-goch.de) 上,我正在显示当前的天气信息。对于移动设备,我将 overflow-y css 属性添加到 div-container。
这在 iOS 的 Safari 上就像魅力一样,但在 Android 上,该网站不允许滚动浏览内容。此外,我的背景图像未缩放到移动设备的视口大小。
我正在通过以下 css 创建背景
<style>
html {
background: url(<?= DataSource::getCurrentTimeLapsePath() ?>) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
HTML 视口元标记
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
洞网站的Sidebar-CSS...
.leftsidebar {
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
overflow:hidden;
z-index:-1;
width: 280px;
height: 100%;
padding: 10px;
background-color: rgba(255,255,255,0.7);
overflow-y: auto;
}
相关媒体查询
@media only screen
and (min-device-width : 320px)
and (max-device-width : 1000px) {
.leftsidebar {
width: 100%;
}
.rightsidebar {
display: none;
}
.radar {
display: none;
}
.statistics {
display: none;
}
}
希望有人能帮我解决这个问题。
【问题讨论】:
-
HTML 代码是什么?请提供 html 以确定发生了什么。你甚至在运行媒体查询吗?
-
@Ravenous 查看已编辑的问题,希望对您有所帮助:)
标签: android html ios css background