Make clicked tab active in Bootstrap

后端 未结 10 895
傲寒
傲寒 2021-01-31 09:02

I am using Django and integrated Bootstrap with Django. Here is my HTML code for the navigation bar:

10条回答
  •  渐次进展
    2021-01-31 09:55

    I think the easiest solution is JavaScript / CSS: Anyway, here is the solution using Jquery. Notice n1,n2 classes in html

    In base.html

       
            
    

    Then in your dashboard template:

    {% block active_link %}.n1{%endblock%}

    In your restaurants template:

    {% block active_link %}.n2{%endblock%}

提交回复
热议问题