Bootstrap CSS Active Navigation

前端 未结 13 2361

On the Bootstrap website the subnav matches up with the sections and changes background color as you or scroll to the section. I wanted to create my own menu without all the

13条回答
  •  感动是毒
    2020-11-27 12:49

    I did something different to solve this (fyi, i'm a complete html/css/js amateur).

    Each of my navbar buttons goes to a new page. so, in each page's html, i put something like this at the bottom:

    
    

    That got it working right away for me.

    P.S. I tried the accepted answer but had no luck as it would also need to remove the 'active' class from the currently active button to truly 'switch' over. I'm sure it's possible, but again, I'm pretty new to this stuff.

提交回复
热议问题