gpt4 book ai didi

html - Bootstrap Navbar 2 背景色

转载 作者:行者123 更新时间:2023-11-28 06:39:10 27 4
gpt4 key购买 nike

你能帮我实现这一点吗,新手,我想在一个导航栏中使用 2 种背景颜色。 Logo 和菜单的不同背景颜色请查看下面的屏幕截图,我将在此处复制并粘贴我的 bootstrap html,谢谢

NavBar ScreenShot

 <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>

最佳答案

只需使用以下 CSS。

.container div.navbar-header
{
background-color: white;
}

.container div#bs-example-navbar-collapse-1
{
background-color: red;
}

关于html - Bootstrap Navbar 2 背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34429747/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com