当div标签被修复时,如何使用导航栏固定?
我想从头开始建立一个网站,我开始添加导航栏似乎工作正常,之后我添加了几个div标签为固定。
我需要它以这样一种方式,当我滚动时,导航栏应该是固定的,其余的内容将滚动...
当我试图让导航栏固定时... div标签正在导航栏上方移动
我已经附上了以下项目
app.box.com/s/5iyj5jc5n3gzah5xwpyt
I wanted to build a website from scratch, I started adding nav bar which seems to work fine and after that I added a few div tags as "fixed".
I need it to be in such a way that when I scroll, the nav bar should be fixed and the rest of the content to be scrolled...
When I tried to make the nav bar fixed .. the div tag was moving above the nav bar
I have attached the project below
app.box.com/s/5iyj5jc5n3gzah5xwpyt
关于实现某些区域滚动的方法,同时保持页面的顶部到位,一个非常简单的方法,就是:
On of the ways to achieve the scrolling of some area while keeping, say, the top portion of the page in place, a very simple one, would be this:
.scrollable { style="overflow-y: scroll; height: 600px; }
考虑以下原型HTML:
Consider the following prototype HTML:
<p>You header content goes here; navigation bad, for example</p>
<div class="scrollable">
<!-- The rest of the page goes here; it will be scrollable -->
</div>
考虑到这一点作为一个开始的想法。
一些更高级的想法: http://webdesign.about.com/od/advancedcss/qt/html-scroll-box-with-css.htm [ ^ ]。
另请参阅: http://www.w3.org/wiki/CSS /属性/溢出 [ ^ ] 。
Consider this just as a starting idea.
Some more advanced ideas: http://webdesign.about.com/od/advancedcss/qt/html-scroll-box-with-css.htm[^].
See also: http://www.w3.org/wiki/CSS/Properties/overflow[^].