【问题标题】:position:fixed does not work in Chrome Mobile位置:固定在 Chrome 移动版中不起作用
【发布时间】:2017-12-09 11:58:49
【问题描述】:

如果有任何元素大于 ca. 400 px(此处为绿色 div)具有 position:fixed 的元素停止被修复。在 Firefox Mobile 中没问题。 “溢出:隐藏或滚动”没有帮助。

这是我的代码:

<!-- <!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fix test</title>
<style>
body {
    margin: auto;
    max-width: 900px;
}
.fix {
    position: fixed;
    top: 110px;
    background-color: orange;
}
.large {
    width: 650px;
    height: 88px;
    background-color: green;
}
</style>
</head>

<body>
<div class="fix">
    <h1> should be fixed </h1>
</div>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<div class="large"></div>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
<h1>sample text</h1>
</body>
</html>
 -->

我能做什么。我想要一些宽于 400 像素的图片。

这是我的例子:my link

【问题讨论】:

    标签: css google-chrome mobile


    【解决方案1】:

    它对我有用,它看起来不起作用,因为身体高度太大而无法在移动设备中显示。 尝试在您的修复类中使用 [top:0] 并查看差异。

    【讨论】:

    • 说唱,谢谢,但 top:0 没有帮助。正如我所说,问题只出在 Chrome 移动版中。
    猜你喜欢
    • 2013-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-07
    • 2013-10-15
    相关资源
    最近更新 更多