Bootstrap navs hover

Viewed 29

I use nav from bootstrap in my website.

When hovering over it then sometimes it is green(as it should be, but sometimes when you reload the website or jump back from a link then the link is blue(default value) when activating and hovering over it.

I use this version of nav

  <ul class="nav justify-content-center">
    <li class="nav-item">
        <a class="nav-link" href="#">test</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="#">test2</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="#">test3</a>
    </li>
</ul>

And in css I have so far used the

a.nav-link {
    color: #68b347;
}

ul.nav a:hover {
    color: #4d8533 !important;
}

ul.nav a:active{
    color: #4d8533 !important;
}

Everything works, but sometimes it does not work and you have to restart the website


1 Answers

try to add this to your css

ul.nav a:visited {
color: #68b347 !important;
}

Then it should always be green

Related