Reputation: 1617
How do I make my font color white, on the current nav bar class?
For example, when I click on a link on the nav it adds a class="current" to that link.
But I'm having trouble styling that particular link.
Here's the HTML:
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-loggedin-nav mineul pull-right" style="font-size:22px;margin-top:7px; color:white;">
<li>
<a class="current" href="/">
</li>
<li>
Here's my CSS attempt which is way off:
.nav > li > a .current {
color: white;
}
Upvotes: 0
Views: 245
Reputation: 7746
HTML
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-loggedin-nav mineul pull-right" style="font-size:22px;margin-top:7px; color:white;">
<li>
<a class="current" href="/">Text Here</a>
</li>
<li>
CSS
a.current {
color: white;
}
Upvotes: 0
Reputation: 349
.nav > li > a.current
Just a small change. The space between "a" and ".current" makes it think .current is a new element.
Upvotes: 1
Reputation: 228
No space between the anchor element selector and the class name selector:
.nav > li > a.current {
color: white;
}
Upvotes: 0