Animated Menu Icon By Using HTML & CSS

 


HTML Code

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <link rel="stylesheet" href="style.css">

</head>

<body>

    <div class="btn">

        <div class="line1"></div>

        <div class="line2"></div>

        <div class="line3"></div>

    </div>

</body>

</html>


CSS Code

.btn{

    background-color: red;

    display: inline-block;

}


.line1,.line2,.line3{

    background-color: black;

    width: 35px;

    height: 5px;

    margin: 6px 0;

}


.btn:hover .line1{

   transform: rotate(-45deg) translate(-9px,6px); 

}


.btn:hover .line3{

    transform: rotate(45deg) translate(-8px,-8px); 

 }


 .btn:hover .line2{

   opacity: 0;

 }

Comments

Popular posts from this blog

How to make simple bill maker by using python tkinter

Make a GST Calculator using HTML and JavaScript

Write a program to find the sum of 1/2+4/3+5/6+8/7+9/10 using loop in java