使整个页面滚动到一定高度的顶部,没有任何滚动条 [英] make the whole page scroll beneath a certain height at the top without any scroll bar

查看:129
本文介绍了使整个页面滚动到一定高度的顶部,没有任何滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 将保持固定在页面的顶部位置。

The div_fixed will remain fixed at the top position of the page.

但是当页面向上滚动时,div other_content 将在div div_fixed 的下边缘消失。

But as the page scrolls up, the content of the div other_content will vanish just at the lower edge of the div div_fixed .

在向下滚动的情况下, other_content 的不可见内容将开始从 div_fixed

In the case of scrolling down the invisible content of other_content will begin to be visible from the lower edge of the div_fixed

如何实现?

strong> EDIT:对任何div都不应出现滚动条

no scroll bar should appear for any div

推荐答案

隐藏以摆脱滚动条

Use overflow: hidden to get rid of scrollbars

这篇关于使整个页面滚动到一定高度的顶部,没有任何滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆