所以我第一次使用Twitter的Bootstrap,我试图在它们崩溃后更改下拉菜单中文本的颜色. (如果这是有道理的)
我使用this site(<<<< ---我正在使用的CSS链接)来帮助一些CSS,但我似乎无法找到正确的代码块来改变正确文本的颜色. 当您压缩网页以显示折叠菜单并转到下拉列表时,您将看到蓝色背景转移到下拉菜单项,但字体颜色为黑色,因此很难阅读.我希望这个字体是白色的.
<nav class="navbar navbar-custom" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <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> <a class="navbar-brand" href="#">ATR Notary</a> </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"> <li class="dropdown"> <a href="~/Order/Index" class="dropdown-toggle" data-toggle="dropdown">Orders <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="~/Order/Index">View Orders</a></li> <li><a href="~/Order/Create">Add Order</a></li> </ul> </li> </ul> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="~/Notary/Index" class="dropdown-toggle" data-toggle="dropdown">Notaries <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="~/Notary/Index">View Notaries</a></li> <li><a href="~/Notary/Create">Add Notary</a></li> </ul> </li> </ul> @Html.Partial("_LoginPartial") </div><!-- /.navbar-collapse --> </nav>
解决方法
你应该可以使用这个CSS ..
/*-- change navbar dropdown color --*/ .navbar-default .navbar-nav .open .dropdown-menu>li>a,.navbar-default .navbar-nav .open .dropdown-menu { background-color: #3344ff; color:#ffffff; }