Changing active dropdown tab background color in bootstrap 3.0

前端 未结 4 574
北荒
北荒 2021-02-04 10:50

I am using the following css to change background color of navbar dropdown active link.

.navbar .nav > li.dropdown.ope         


        
相关标签:
4条回答
  • 2021-02-04 11:21

    What worked for me:

    .navbar-default .navbar-nav .dropdown.open a:focus {
        background-color: #6dbcc9;
    }
    
    0 讨论(0)
  • 2021-02-04 11:24

    I think this should work:

    .nav.nav-tabs > li.dropdown.active.open > a, 
    .nav.nav-tabs > li.dropdown.active.open > ul.dropdown-menu a:hover,
    .nav.nav-tabs > li.dropdown.open > a, 
    .nav.nav-tabs > li.dropdown.open > ul.dropdown-menu a:hover
    {
      color: #fff;
      background-color: #b91773;
      border-color: #fff;
    }
    

    Note no space between .nav.nav-tabs cause to select for having both and not the second followed by the first.

    caret:

    .nav.nav-tabs > li.dropdown.active.open > a span.caret {border-top-color: #fff;border-bottom-color: #fff;}
    
    0 讨论(0)
  • 2021-02-04 11:33

    You should fint the exact class of the dropdown menu. It could be in your nav or not. I changed the active class color of the pagination property of the Bootstrap Theme like this:

    ul.dropdown-menu>li.active>a:hover{
        background: #419641 !important;
    }
    
    ul.dropdown-menu>li.active>a{
        background: #51AB51 !important;
    }
    
    0 讨论(0)
  • 2021-02-04 11:41

    It would be a lot easier if you could make a jsfiddle. if not then here is what you can do.

    1- make sure that the tab Added lies exactly in ".nav .nav-tabs > li.dropdown.open.active" classes and the path is correct. IF not, it wont work.

    2- So, find out if you have added a class that is not relevant or you have not added a relevant class.

    0 讨论(0)
提交回复
热议问题