【发布时间】:2013-10-15 18:09:12
【问题描述】:
如何在移动浏览器(ios和android)中固定元素位置? 在 ios 中,元素仍然使用以下代码滚动
<html>
<head>
<style>
.fixed{
position:fixed;
top:0;
left:0;
}
</style>
</head>
<body>
<div class="fixed">
Hi I m Position Fixed
</div>
<div>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
sample text<br/>
</div>
</body>
</html>
【问题讨论】:
-
回答您自己的问题是可以的,但请正确回答。用对问题的描述而不是介绍(而不是相反)使这个问题成为一个明确的问题。
-
嗯...你仍然可以编辑。
-
嗨@Vicky。我怀疑你的问题因为你措辞“健谈”的方式而引起了反对票——最初,它读起来像一篇博客文章,而不是一个问题。绝对鼓励发布然后回答您自己的问题 (meta.stackexchange.com/questions/17463/…) - 请注意将您的问题设置为问题,然后发布答案,而不是在问题字段中写博客式的帖子。希望这有帮助!
标签: javascript android html css position