html:
<div class="div_fixed"></div>
<div class="other_content">
content goes here
</div>
CSS:
.div_fixed{
position:fixed;
height:40px;
}
.other_content{
height:200px;
}
div_fixed
将固定在页面的顶部。
但是随着页面向上滚动,div other_content
的内容将消失在 div div_fixed
的下边缘。
在向下滚动的情况下,other_content
的不可见内容将从 div_fixed
的下边缘开始可见
如何实现?
编辑:任何 div 都不应出现滚动条
最佳答案
使用overflow: hidden
去除滚动条
关于javascript - 使整个页面滚动到顶部一定高度以下,没有任何滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11774250/