Bootstrap 3 - Change dropdown background colour

前端 未结 4 661
灰色年华
灰色年华 2021-01-26 03:46

I\'m quite new to Bootstrap, I\'ve set up a dropdown pill and played around with the colours.

What I\'d like to do is change the colour of the dropdown title pill after

相关标签:
4条回答
  • 2021-01-26 04:08

    This will change the background/text color of the active class (inc. focus):

    .navbar-default .navbar-nav>.active>a,
    .navbar-default .navbar-nav>.active>a:focus {
        color: white;
        background-color: blue;
    }
    
    0 讨论(0)
  • 2021-01-26 04:15
    .nav>li>a:hover,.nav>li>a:visited {
         background-color: #222; /* add your desired color */
    }
    
    0 讨论(0)
  • 2021-01-26 04:19

    Use following css:

    .nav .open>a, .nav .open>a:hover, .nav .open>a:focus{
    background-color: red;
    }
    .nav-tabs>li>a:hover {
    background-color: red;
    }
    

    DEMO

    0 讨论(0)
  • 2021-01-26 04:24

    You would override the hover, active and focus state of .nav-pills like this..

    .nav-pills>li>a:hover {
        background-color: #FF6699;
    }
    .nav-pills .open>a, .nav-pills .open>a:active, .nav-pills .open>a:focus{
        background-color: #FF6699;
    }
    

    Demo

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