Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda