当我包含bootstrap-theme-min.js时,Bootstrap导航栏菜单颜色覆盖不起作用

没有bootstrap-theme.min.css:

css - 当包含主题最小CSS时,Bootstrap 3覆盖导航栏颜色不起作用-LMLPHP

使用bootstrap-theme.min.css:
css - 当包含主题最小CSS时,Bootstrap 3覆盖导航栏颜色不起作用-LMLPHP

页面上包含bootstrap-theme.min.css时如何覆盖。

#my-bootstrap-menu.navbar-default .navbar-brand {
    color: rgba(250, 245, 245, 1);
}
#my-bootstrap-menu.navbar-default {
    font-size: 14px;
    background-color: rgba(58, 8, 158, 0.86);
    border-width: 1px;
    border-radius: 4px;
}
#my-bootstrap-menu.navbar-default .navbar-nav>li>a {
    color: rgba(250, 250, 250, 1);
    background-color: rgba(248, 248, 248, 0);
}
#my-bootstrap-menu.navbar-default .navbar-nav>li>a:hover,
#my-bootstrap-menu.navbar-default .navbar-nav>li>a:focus {
    color: rgba(245, 231, 231, 1);
    background-color: rgba(245, 82, 17, 1);
}
#my-bootstrap-menu.navbar-default .navbar-nav>.active>a,
#my-bootstrap-menu.navbar-default .navbar-nav>.active>a:hover,
#my-bootstrap-menu.navbar-default .navbar-nav>.active>a:focus {
    color: rgba(245, 233, 233, 1);
    background-color: rgba(242, 75, 9, 1);
}
#my-bootstrap-menu.navbar-default .navbar-toggle {
    border-color: #f24b09;
}
#my-bootstrap-menu.navbar-default .navbar-toggle:hover,
#my-bootstrap-menu.navbar-default .navbar-toggle:focus {
    background-color: #f24b09;
}
#my-bootstrap-menu.navbar-default .navbar-toggle .icon-bar {
    background-color: #f24b09;
}
#my-bootstrap-menu.navbar-default .navbar-toggle:hover .icon-bar,
#my-bootstrap-menu.navbar-default .navbar-toggle:focus .icon-bar {
    background-color: #3a089e;
}


fiddle

最佳答案

代替使用background-color属性,在此使用background

#my-bootstrap-menu.navbar-default { background-color: rgba(58,8,158,0.9); }




#my-bootstrap-menu.navbar-default { background: rgba(58,8,158,0.9); }

关于css - 当包含主题最小CSS时,Bootstrap 3覆盖导航栏颜色不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37893834/

10-12 00:08
查看更多