的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
摆脱滚动条