Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!