Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
How to change the dropdown button's caret symbol when clicked ? HTML CSS Javascript

enter image description here

Suppose I have a dropdown button that looks like the picture above.

When I click on this drop down, it looks like this,

enter image description here

Notice, how the caret symbol "v" is still inverted.

I want that caret symbol to be "^" instead.

Here is the code I have so far.

<div class="dropdown">
   <button id="num-of-results-btn" data-target="#myDropdown" class="dropbtn">30 results</button>
   <div id="myDropdown" class="dropdown-content">
       <a href="">10 results</a>
       <a href="">20 results</a>
       <a href="">30 results</a>
   </div>
</div>

I have copied this snippet of code from the link

"https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown"

From the link above, there is no caret symbol at all.

But when I copy that code into my project, suddenly the caret symbol appears.

So, how can I located that caret symbol and manipulate it the way I described above ?

I would appreciate any pointers or tips that can throw me in the right direction.

Here is the CSS that I am applying to this code.

.dropbtn{
    height: 48px;
    width: 200px;
    padding: 0;
    margin: 0;
    text-align: start;
    padding-left: 1rem;
    background: white;
    border: 1px solid #D6D6D6;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    line-height: 24px;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: lightskyblue;
}

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    width: 198px;
    overflow: auto;
    border: 1px solid #D6D6D6;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
  }

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

Also, my project does include the bootstrap4.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda