Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add an active class to current element in navbar in django

<li {% if request.resolver_match.url_name == 'home' %}class="active"{% endif %}>
    <a href="/">HOME</a>
</li>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #active #class #current #element #navbar #django
ADD COMMENT
Topic
Name
2+1 =