我無法將CSS樣式應用於li。當然,這個問題不是特異性的,但我不知道如何選擇李的 - 我只是想能夠設計這些李的白色,並應用與品牌標題相同的懸停效果。將CSS應用到li的問題 - 最終特異性失敗
關於我要去哪裏的任何想法都是錯誤的?
/* MAKES HEADER NAVBAR NO WIDER THAN 960PX */
.width-960px { max-width: 960px; }
.no-padding-unless-mobile {
padding: 0;
}
.navbar {
margin-bottom: 50px;
background: #3C7AAD;
}
.navbar-header .navbar-brand {
color: #fff;
}
.navbar-header .navbar-brand:hover {
color: #D5D5D5;
}
/* I can't be any more specific than this... */
.navbar .navbar-default .navbar-static-top .container .width-960px .no-padding-unless-mobile .collapse .navbar-collapse .navHeaderCollapse .nav .navbar-nav .navbar-right ul li a {
color: #fff;
}
<header class="navbar navbar-default navbar-static-top">
<div class="container width-960px no-padding-unless-mobile">
<div class="navbar-header">
<a href="index.html" class="navbar-brand">Brand Name</a>
<!-- MOBILE BUTTON - VIEWABLE ON MOBILE SIZED BROWSERS ONLY -->
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<!-- HAMBURGER MENU -->
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<nav class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="matches.html">Link 1</a></li>
<!--<li><a href="#">NEWS</a></li>-->
<li><a href="products.html">Link 2</a></li>
<li><a href="contact.html">Link 3</a></li>
</ul>
</nav>
</div>
</header>