简体   繁体   English

如何使用Bootstrap制作此(粘性,全角)导航栏?

[英]how can I make this (sticky, full-width) navbar using Bootstrap?

I have spent literally hours (I'm new to coding) trying to replicate this navbar ( https://bootstrapmade.com/demo/MyResume/ ) but couldn't do it. 我花了数小时(我是编码新手)尝试复制此导航栏( https://bootstrapmade.com/demo/MyResume/ ),但无法做到。 I'm not sure if it requires JavaScript knowledge (I only know HTML, CSS, and Bootstrap). 我不确定是否需要JavaScript知识(我只知道HTML,CSS和Bootstrap)。 Any help how to do it? 有什么帮助吗?

It's called "ScrollSpy". 它称为“ ScrollSpy”。 You can find it in the documentation here . 您可以在此处的文档中找到它。

<body data-spy="scroll" data-target="#navbar-example">
  ...
  <div id="navbar-example">
    <ul class="nav nav-tabs" role="tablist">
      ...
    </ul>
  </div>
  ...
</body>
$('body').scrollspy({ target: '#navbar-example' })

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

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