-4

So, i want to make an active links in navbar, but it's working only on "Pocetna" page, but not on others...this is what i've done:

<nav>
    <ul>
        <a href="#"><li class="active">Pocetna</li></a>
        <a href="#"><li>Forum</li></a>
        <a href="#"><li>Galerija</li></a>
        <a href="#"><li>Donacije</li></a>
        <a href="#"><li>O nama</li></a>
    </ul>
</nav>

and this is in my style.css :

nav li.active{
    color: #CCCCCC;
}

I'm using bootstrap...

Monk
  • 1
  • 2
  • 3
    You need the class `active` to move to the relevant `li` for each page. You can do it manually or programmatically. – sol Oct 10 '17 at 08:53
  • @ovokuro any examples? – Monk Oct 10 '17 at 08:54
  • The simplest solution would be to just move the `class="active"` attribute to the relevant `li` depending what page you are on. – Michael Hancock Oct 10 '17 at 08:55
  • Since you are using Bootstrap, check in the dev tools if the `active` class changes within the `
  • ` elements, and I don't see any other Bootstrap classes, or move the class depending on what page you are on
  • – Carl Binalla Oct 10 '17 at 08:55
  • 1
    First correct your html markup. Place `a` tag inside `li` tag. May be this will help you: https://stackoverflow.com/questions/24514717/bootstrap-navbar-active-state-not-working – Bhuwan Oct 10 '17 at 09:01