Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Nav Bar Active

I'm using the navbar from bootstrap however whenever I click on one of the page titles, the navbar doesn't highlight it to show that I'm on that page. For example, if I'm on the home page then the navbar looks like this:
enter image description here

However, if I click on About, I go to the About page but the navbar still looks like this:
enter image description here

How do I make it highlight the page it's on? Thanks

like image 535
Richard Avatar asked Apr 13 '13 22:04

Richard


1 Answers

Read documentation. You need to apply class="active" to the li element that you want to be active. It is not handled automatically. You need to implement it however you see fit.

It could be either a JQuery solution or a server side solution. Either one could be more or less appropriate depending on the way your website is built.

like image 184
Dmitry Efimenko Avatar answered Sep 29 '22 01:09

Dmitry Efimenko