Dropdown Menu Items do not change color

Asked

Viewed 969 times

0

UPDATE

I am developing a web application and I put the bootstrap menu and I would like the menu items to change color and not in this black color but in the color #00008B

Menu items

inserir a descrição da imagem aqui

HTML

   <ul class="dropdown-menu">
                      <li class="conteudo_drop"><a href="#"><i class="fa fa-laptop"></i> Meus Pedidos</a></li>
                       <li class="conteudo_drop"><a href="#"><i class="fa fa-gear"></i> Meus Dados</a></li>
                       <li class="conteudo_drop"><a href="#"><i class="fa fa-group"></i> Fale Conosco</a></li>
                        <li><a href="#"><button type="button" onclick="" class="btn_entrar" >Entrar</button> </a></li>
                         <li class="conteudo_drop"><a href="cadastro.jsp"> Cliente novo? Cadastre-se</a></li>
                    </ul>

CSS

 .dropdown-menu{

        background-color: white;
        color:white;
    }
    .conteudo_drop{

        color:#00008B !important;
    }
  • I think you can’t put one <li> within a <div>

  • Add the class you have on the Divs in <li> and then take out the Ivs

  • I took the div inside the li and put the class inside the li, the items appeared but the Hover effect didn’t work

  • l_like_trains I updated the question and put the new codifo

  • Ever tried to use color: red !important?

  • What do you want to change color? the background or the letters? maybe a verifiable example will help you

  • I want you to change the background color and color of the items. Example . conteudo_drop a:Hover{ color: red; text-Decoration: None; background-color: blue; }

  • Rafael Augusto worked now when passing the mouse over the items they change color and the background color, but now the problem is that I can not change the color of the menu items, updated the question and the new problem

Show 3 more comments

2 answers

2


The tag <a> has a default style, and in Bootstrap for sure the color is applied directly to it.

Then you should apply the color to the tag <a>, thus:

.conteudo_drop a {
  color:#00008B;
}

0

Instead of putting a class in the li tag, put a style inside it to determine the color you want.

If it does not work, you can enter the Bootstrap code and change the color directly in the class . conteud_drop.

Browser other questions tagged

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