Change bootstrap btn class Hover

Asked

Viewed 1,349 times

0

Hello.

I have a menu with bootstrap, but a certain item is with the btn-Success class. The problem is when I hover over this item, the background turns white. As I would for the background to remain green?

<div class="navbar navbar-default navbar-static-top">
            <div class="container">
                <div class="navbar-collapse collapse ">
                    <ul class="nav navbar-nav">
                       ....
                       <li class="btn-success btn-xs">Acessar</li>
                       ....
                    </ul>
                </div> 
            </div>
</div>
  • Draw up a [mcve], please.

1 answer

1


Have you tried using the attribute !important?

li.btn-success:hover{
   background-color: green !important;
} 

With the attribute in question, priority will be given to background-color defined by you.

  • Hello Leandro. Unfortunately it didn’t work.

  • 1

    @Fox.11 I edited the answer, try again.

  • In my view, use !important is never a solution and should never be. The problem can be solved in more appropriate ways than simply forcing the browser to do something. But these ways will only be possible to present when @Fox.11 presents all the details of the problem.

  • 1

    Thanks Leandro. It worked.

  • Hello Anderson. Leandro’s solution worked. Thank you.

  • Not always working solution is a valid solution.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.