更改活动<li> Bootstrap CSS </li>

时间:2014-11-06 00:42:31

标签: jquery html css twitter-bootstrap web

我一直很难改变导航的活动风格,这是我的代码

 <nav id="myheader" class="navbar navbar-inverse" role="navigation">
        <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>                        
            </button>
        <a class="navbar-brand" href="#">Jake Balba</a>
        </div>


        <div class="collapse navbar-collapse" id="myNavbar">
        <ul class="nav navbar-nav">
                    <li class="active"><a href="index.html">Home</a></li>
                    <li><a href="About.html">About</a></li>
                    <li><a href="partners.html">Web Projects</a></li>
                    <li><a href="partners.html">Contact</a></li>

不知道该怎么做尝试了很多Css。谢谢!

1 个答案:

答案 0 :(得分:0)

您只需将样式应用于.navbar-inverse .navbar-nav>.active>a,例如:

.navbar-inverse .navbar-nav>.active>a {
  background-color: red;
}

示例:http://www.bootply.com/srYcUctkrb