-1

On the inverse navbar in bootstrap when I add a dropdown menu and click on it the background color turns black and then turns back to the original color when I click off it.

I am trying to get me other links in the navbar to do the same. Here is one thing that I have tried for my home link:

.navbar .home > .active > a, 
.navbar .home > .active > a:hover, 
.navbar .home > .active > a:focus {

    background-color: #000000 !important;
}

This doesn't seem to do anything though. Any ideas?

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
josh
  • 43
  • 1
  • 8

1 Answers1

0

You just need to add this to your stylesheet overriding the existing background-color coming from bootstrap stylesheet for all the behaviors. You can remove the styling that you mentioned above

.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover {
    background-color: transparent;
}

Here the Codepen demo

Nikhil Nanjappa
  • 6,454
  • 3
  • 28
  • 44