Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Bootstrap navs hover

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  <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


>Solution :

try to add this to your css

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

Then it should always be green

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading