[英]Bootstrap navbar with class “navbar-fixed-top” not staying fixed
On my website, I am using the navbar-fixed-top class as per bootstrap's docs.在我的网站上,我按照引导程序的文档使用导航栏固定顶部 class。 I want my nav to stay fixed but unfortunately the position becomes relative upon viewing the page source.我希望我的导航保持固定,但不幸的是 position 在查看页面源时变得相对。 Here is my code.这是我的代码。
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="navId">
<li class="nav-item">
<a href="{{ url_for('home')}}" class="nav-link active">Home</a>
</li>
<li>
<a href="{{ url_for('notebook_reference')}}" class="nav-link active">Work</a>
</li>
</ul>
</div>
</nav>
I am quite confused on this.我对此感到很困惑。 I believe I have followed this example properly.我相信我已经正确地遵循 了这个例子。 If someone knows my error here, let me know!如果有人在这里知道我的错误,请告诉我!
One more thing.还有一件事。 I have NOT overriden any styles of bootstrap.我没有覆盖引导程序的任何 styles。
<nav class="navbar navbar-default navbar fixed-top">
Just remove "-" between navbar and fixed top只需删除导航栏和固定顶部之间的“-”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.