【发布时间】:2019-08-18 10:41:28
【问题描述】:
我的网站在移动 safari 中一路上升,徽标的顶部被永久可见的地址栏遮挡。应该在代码中进行哪些更改以使网站在地址栏下方开始(正常)?
我遇到问题的网站是:https://www.chroma.nl/chromamichiel
编辑:部分 html 是基于 google 的这个演示:https://googlechromelabs.github.io/ui-element-samples/parallax/,这似乎在移动 safari 中运行良好......但是我无法发现导致这种不一致的任何差异。
html, body {
width: 100%;
height: 100%;
margin: 0;
background-color: grey;
}
.viewport {
height: 100%;
width: 100%;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
text-align: center;
margin: auto;
padding: 0;
overflow-x: hidden;
overflow-y: auto;
position: fixed;
-webkit-overflow-scrolling: touch;
}
.width {
width: 90%;
margin: auto;
}
.item {
height: 2000px;
width: 100%;
background-color: blue;
background-image: url(www.lorempixel.com/1000/1000/sport/);
background-size: cover;
}
<body>
<div class="viewport" >
<div class="width">
<div class="item">
</div>
</div>
</div>
</body>
【问题讨论】:
标签: html ios css mobile safari