London Smith
London Smith

Reputation: 1659

Navbar item opening dropdown menu change background

How to change background of a navbar item opening a dropdown-menu:

Navbar link opening dropdow-menu

HTML:

<ul class="nav navbar-nav navbar-right">
  <li>
    <a href="#/" class="dropdown-toggle nav-lang" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">FR<span class="caret"></span></a>
    <ul class="dropdown-menu">
      <li><a class="nav-lang" href="?lang=fr"><img height="15" src="/images/navbar-fr.png"><span class="pad-l-10 fnt-rob pad-t-10">English</span></a></li>
    </ul>
  </li>
</ul>

The CSS I tried with no success:

.navbar-nav > li > a.nav-lang .active {
  background:#93b874 !important;
}

#93b874 is the green color, actually I don't want background color when we click on this item.

Upvotes: 1

Views: 139

Answers (1)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167172

There shouldn't be any space after the .:

.navbar-nav > li > a.nav-lang.active
//---------------------------^^ Remove the space here.

When the space is given, it looks for a child element to apply the styles for.

And give background: none transparent; if needed with !important.

Looks like the answer lies in:

.navbar-nav > li > a.nav-lang { background:none transparent !important; }

Upvotes: 1

Related Questions