你能帮助我做到这一点,新手,我想在一个导航栏中有2种背景颜色。徽标的不同背景颜色以及菜单请查看下面的截图,我将复制并粘贴我的bootstrap html谢谢
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="col-md-12">
<a class="navbar-brand page-scroll" href="#page-top"><img src=""></a>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="#services">About Us</a>
</li>
<li>
<a class="page-scroll" href="#portfolio">Services</a>
</li>
<li>
<a class="page-scroll" href="#about">News & Events</a>
</li>
<li>
<a class="page-scroll" href="#team">Career</a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
答案 0 :(得分:0)
只需使用以下CSS。
.container div.navbar-header
{
background-color: white;
}
.container div#bs-example-navbar-collapse-1
{
background-color: red;
}
答案 1 :(得分:0)
.container div.navbar-header{background-color: #eeeeee;}
.container div#bs-example-navbar-collapse-1{background-color: #f82225;}