简体   繁体   English

如何使我的顶级菜单保持滚动显示?

[英]How to keep my top menu stay fixed on scroll?

Website: http://revelationcraft.com/ 网站: http//revelationcraft.com/

In this page I want the top menu to stay on the top of the page when a user/member scrolls. 在此页面中,我希望当用户/成员滚动时,顶部菜单保持在页面顶部。

I'm wondering if this is possible if so please tell me how. 我想知道是否可以,请告诉我如何。

Add position:fixed; 添加position:fixed; to div#ln-bar . div#ln-bar

There are many questions on this such as this: How to create sticky header bar for a website It is called a sticky header and can be created in many different languages such as css, and jQuery. 诸如此类的问题有很多: 如何为网站创建粘性标题栏它被称为粘性标题,可以用多种不同的语言(例如CSS和jQuery)创建。 All you have to do in this case is create a div for your header and use this: position:fixed; 在这种情况下,您要做的就是为标头创建一个div并使用以下代码: position:fixed; . All you have to do is make the z-index higher than any other div or class so you don't have any troubles with this, unless of course, you want to have that happen. 您所要做的就是将z-index设置为高于其他任何div或类,这样您就不会遇到任何麻烦,除非您当然希望发生这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM