Bootstrap: Scrollspy in bootstrap 4.0.0-beta seems not working

Created on 16 Aug 2017  路  6Comments  路  Source: twbs/bootstrap

I tried to follow the documentation:

CSS:
body {position: relative;}
.active a, .active{color: red;}
HTML:

&lt;body data-spy="scroll" data-target="#navbar-example"&gt; &lt;div id="navbar-example"&gt; &lt;ul class="nav" role="tablist"&gt; &lt;li&gt;&lt;a href="#one"&gt;one &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#two"&gt;two &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#three"&gt;three&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; ....... ....... ....... </body>

But it's not working. What's wrong with me??

Please review this file that I did
https://www.dropbox.com/s/jfhvq1ip87ekcxs/Untitled-1.html?dl=0

Thank you for your support!

js v4

Most helpful comment

The required use of nav-link really ought to be in the docs.

All 6 comments

Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via JS Bin or CodePen and report back with your link, Bootstrap version, and specific browser and OS details.

Ok, it's my issue, scrollspy bootstraps 4 beta not working:
https://codepen.io/anon/pen/rzpWEr
Tks!

I works once you add "nav-link" class to the links in your menu https://codepen.io/pehaa/pen/braKZB

Wow, so amazing! Thanks so much!!!!!

Closed thanks to @pehaa comment's 馃憤

The required use of nav-link really ought to be in the docs.

Was this page helpful?
0 / 5 - 0 ratings