5

我不确定是否正确,但在导航栏中使用引导导航药丸不起作用,因为导航在 bootstrap.css 中具有优先权。如果正确,那么我们是否不应该在导航栏中使用这些导航样式?

4094行.nav-pills > .active > a, .nav-pills > .active > a:hover, .nav-pills > .active > a:focus { color: #ffffff; background-color: #0088cc; }

第 4623 行

 .navbar .nav > .active > a,
    .navbar .nav > .active > a:hover,
    .navbar .nav > .active > a:focus {
      color: #555555;
      text-decoration: none;
      background-color: #e5e5e5;
      -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
         -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
              box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
    }
4

1 回答 1

5

您可以通过以下方式使用它:
Jsfiddle with navbar and navpills

 .navbar .nav-pills >li >a {
    color: #005580;
 }
   .navbar .nav-pills > li > a:hover {
      background-color: #0088cc;
 }
 .navbar .nav-pills .active > a {
    background-color:#ccc;
    color:#0088cc;
}

<div class="navbar">
<div class="navbar-inner">
<a data-toggle="collapse" data-target=".nav-collapse" class="btn btn-navbar">
  <i class="icon-bar"></i>
  </a>

    <a class="brand" href="">New Icon Menu</a>

    <div class="nav-collapse">
        <ul class="nav nav-pills pull-right">
            <li><a href=""><i class="icon-home icon-2x"></i> Home<br></a>
            </li>
            <li><a href=""><i class=" icon-pencil icon-2x"></i>About Us</a>
            </li>
            <li><a href=""><i class=" icon-briefcase icon-2x"></i>Portfolio</a>
            </li>
            <li><a href=""><i class=" icon-envelope icon-2x"></i>Contact Us</a>
            </li>
        </ul>
         </div>
       </div>
     </div>
于 2013-02-25T13:11:42.593 回答