如何使这个导航栏浮动在顶部同时滚动? [英] How to make this navigation bar floating on top while scrolling?

查看:106
本文介绍了如何使这个导航栏浮动在顶部同时滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

整个导航栏及其JavaScript设置可在此处找到

The whole navigation bar along with its JavaScript settings can be found here

http://jsfiddle.net/DyJzg/3/

现在它停留在页面的顶部,但我是不知道它是否可以浮动在顶部,即使当你向下滚动页面。感谢。

right now it stays at the top of the page, but i am wonder whether it could be made floating on top even when you scroll down the page. Thanks.

推荐答案

我认为你需要使用 position:fixed / p>

I think you need to use position:fixed

nav {
position:fixed;
top:0;
width:100%;
}

这里是 modified jsfiddle

这篇关于如何使这个导航栏浮动在顶部同时滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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