gpt4 book ai didi

css - Bootstrap 下拉切换类 - 在选项处于事件状态时更改背景颜色

转载 作者:太空宇宙 更新时间:2023-11-04 10:11:44 24 4
gpt4 key购买 nike

我有一个使用 Bootstrap 的导航栏菜单。一个选项是下拉菜单。单击此选项时,会出现灰色背景色。我如何使用 CSS 覆盖它?

<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class ="navbar-tggle collapsed" data-toggle="collapse" data-target="#collapsedNav">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php" style="color: #bcc6cc;" class="navbar-brand"><img src="images/logo.png" alt="Tampa Bay Developers" id="tbdLogo">Tampa Bay Developers</a>
</div>
<div class="collapse navbar-collapse" id="collapsedNav">
<ul class="nav navbar-nav">
<li class="active2"><a href="#">Products</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Support</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Articles</a></li>
<li><a href="#">Related Sites</a></li>
</ul>
</li>
</ul>
<button type="button" class="btn btn-default navbar-btn navbar-right">Contact Us</button>
</div>
</div>
</nav>

最佳答案

CSS:

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:focus,
.navbar-default .navbar-nav > .open > a:hover {
background: red;
}

关于css - Bootstrap 下拉切换类 - 在选项处于事件状态时更改背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37549403/

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