Html 引导菜单栏活动选项卡

Html 引导菜单栏活动选项卡,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我一直无法让引导菜单栏显示活动选项卡。我曾经创建过我的菜单栏,它在网站上显示了一个活动选项卡。然而,在我的网站上它不起作用。如何添加活动选项卡 我试过: #custom-bootstrap-menu.navbar-default .active{ background-color: blue; } HTML: 将active放入所需的之一。希望获得此帮助您还应该将.active类添加到元素之一: <li class="active"> <a href="/pro

我一直无法让引导菜单栏显示活动选项卡。我曾经创建过我的菜单栏,它在网站上显示了一个活动选项卡。然而,在我的网站上它不起作用。如何添加活动选项卡

我试过:

#custom-bootstrap-menu.navbar-default .active{
    background-color: blue;
}
HTML:


active
放入所需的
  • 之一。希望获得此帮助

    您还应该将
    .active
    类添加到
  • 元素之一:

    <li class="active">
       <a href="/products">Products</a>
    </li>
    
    
    切换导航
    
    添加:

    
    

    这应该行得通。希望它对您有所帮助

    您没有在任何地方使用
    active
    类。将其放在一个
  • 元素上。你的CSS工作得很好。Bootstrap给出了一个例子。你可以检查元素,看看它是如何工作的。哇,这很简单。非常感谢。把你的答案标记为正确,因为它是最彻底的,明白了!感谢您检查HTML注释sysntax。
    #custom-bootstrap-menu.navbar-default .navbar-brand {
        color: rgba(255, 255, 255, 1);
    }
    #custom-bootstrap-menu.navbar-default {
        font-size: 15px;
        background-color: rgba(47, 196, 116, 1);
        background: -webkit-linear-gradient(top, rgba(54, 135, 2, 1) 0%, rgba(47, 196, 116, 1) 100%);
        background: linear-gradient(to bottom, rgba(54, 135, 2, 1) 0%, rgba(47, 196, 116, 1) 100%);
        border-width: 1px;
        border-radius: 4px;
    }
    #custom-bootstrap-menu.navbar-default .navbar-nav>li>a {
        color: rgba(255, 255, 255, 1);
        background-color: rgba(248, 248, 248, 0);
    }
    #custom-bootstrap-menu.navbar-default .navbar-nav>li>a:hover,
    #custom-bootstrap-menu.navbar-default .navbar-nav>li>a:focus {
        color: rgba(255, 255, 255, 1);
        background-color: rgba(68, 229, 74, 1);
    }
    #custom-bootstrap-menu.navbar-default .navbar-nav>.active>a,
    #custom-bootstrap-menu.navbar-default .navbar-nav>.active>a:hover,
    #custom-bootstrap-menu.navbar-default .navbar-nav>.active>a:focus {
        color: rgba(255, 255, 255, 1);
        background-color: rgba(66, 165, 3, 1);
        background: -webkit-linear-gradient(top, rgba(54, 135, 2, 1) 0%, rgba(66, 165, 3, 1) 100%);
        background: linear-gradient(to bottom, rgba(54, 135, 2, 1) 0%, rgba(66, 165, 3, 1) 100%);
    }
    #custom-bootstrap-menu.navbar-default .navbar-toggle {
        border-color: #42a503;
    }
    #custom-bootstrap-menu.navbar-default .navbar-toggle:hover,
    #custom-bootstrap-menu.navbar-default .navbar-toggle:focus {
    
        background-color: #42a503;
    }
    #custom-bootstrap-menu.navbar-default .navbar-toggle .icon-bar {
        background-color: #42a503;
    }
    #custom-bootstrap-menu.navbar-default .navbar-toggle:hover .icon-bar,
    #custom-bootstrap-menu.navbar-default .navbar-toggle:focus .icon-bar {
        background-color: #2fc474;
    }
    
    <li class="active">
       <a href="/products">Products</a>
    </li>
    
    <div class="active">
    <!–– YOUR CODE --!>
    </div>