0
我在使用引導程序在頁面首次打開時具有透視導航,但只要用戶向下滾動並且導航欄摺疊,它就會更改爲白色背景。僅在摺疊時更改引導程序漢堡包顏色
我用這個方法,使背景顏色變化:
.top-nav-collapse {
background-color: #FFFFFF !important;
}
我從粗放谷歌搜索知道,這改變了漢堡包圖標的一般顏色:
.navbar-default .navbar-toggle .icon-bar {
background-color: black;
}
不過,我可以似乎只有在崩潰時纔會改變顏色。這是我的導航條形碼:
<nav class="navbar navbar-fixed-top z-depth-1" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
<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 waves-effect waves-light pull-left" href="/"><%= image_tag 'Flame.png', style: "height: 100%"%></a>
</div> <!-- navbar-header -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav">
<li><a href="#" class="waves-effect waves-light">Workouts <span class="sr-only">(current)</span></a></li>
<li><%= link_to 'Blog', posts_path, class:"waves-effect waves-light" %></li>
<li><a href="#" class="waves-effect waves-light">Equipment</a></li>
<li><a href="#" class="waves-effect waves-light">About Us</a></li>
</ul>
</div> <!-- navbar collapse -->
</div> <!-- container-fluid -->
</nav>
任何人都可以對此有所瞭解嗎?
很難完全理解你在問什麼,但我想你只是在尋找'.navbar-toggle.collapsed .icon-bar {...}'? – Quantastical
美麗。我必須讓它成爲'重要的'它才能註冊,但它工作! – Liz