timpone
timpone

Reputation: 19939

how to style this via css in Bootstrap

I'd like to override the nav link-color in a role=presentation for a nav list. I'd like to set it to yellow. I am only looking to select this one instance.

the html:

<ul class="nav nav-pills nav-stacked">
  <li role="presentation"><a href="about.html">About</a></li>

I have:

li[role=presentation] a:link{
  color:yellow;
}

But this doesn't work. Any ideas on how to get this to work?

Upvotes: 0

Views: 82

Answers (2)

indubitablee
indubitablee

Reputation: 8206

take the :link out of your css selector

li[role=presentation] a{
  color:yellow;
}
<ul class="nav nav-pills nav-stacked">
    <li role="presentation"><a href="about.html">About</a></li>
    <li role=""><a href="about.html">About</a></li>
    <li role="presentation"><a href="about.html">About</a></li>
</ul>

Upvotes: 3

GabrielSNM
GabrielSNM

Reputation: 371

Try:

li[role="presentation"] a{
  color: yellow !important;
}

Upvotes: 1

Related Questions