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

121
Visualizações
How to transform 3 bars (&#9866) into a "-X" using Transform and Transition

    #menu{  
        transition-duration: 1s;
        transition-timing-function: ease-out;
    }
    #menu:hover div:nth-of-type(1){
        transform-origin: top;
        transform: rotate(45deg);
        transition-duration: 1s;
        transition-timing-function: ease-out;
        
    }

    #menu:hover div:nth-of-type(3){
        transform-origin: 1px bottom;
        transform: rotate(-45deg);
        transition-duration: 1s;
        transition-timing-function: ease-out;
    }

    #menu:hover div:nth-of-type(2){
        transform: translateX(-10px);
        transition-duration: 1s;
        transition-timing-function: ease-out;
    }
<html>
      <head></head>
      <body>

                
                <div id="menu" >
                    <div class="bar" id="br1">&#9866</div>
                    <div class="bar" id="br2">&#9866</div>
                    <div class="bar" id="br3">&#9866</div>
                </div>
      </body>

The code is supposed to turn the 3 bars (&#9866) into a "-X" when we hover over the div(menu) by using the transform element form CSS but It's somehow not doing so

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Can you please check the below code? Hope it will work for you

Please refer to this link: https://jsfiddle.net/yudizsolutions/5x7kefwj/1/

We have made changes in the Html file, instead of using hexcode we have wrapped the bars in a span tag and also made changes in the CSS file by applying (tranfrom-origin: right) as it will set its position on right instead of center, and on hover, we have applied ( transform: rotate( ) ) and now you will get the desired output.

about 4 years ago · Juan Pablo Isaza Relatório
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