cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html>
<head>
    <meta charset="UTF-8">
    <title>Hamburger Icon</title>
    <link rel="stylesheet" href="style.css">
  <link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script src="script.js"></script>
    </head>
<body>
    <div id="burger-container">
    <div id="burger">
        <span> &nbsp;</span>
         <span> &nbsp;</span>
         <span> &nbsp;</span>
         <span> &nbsp;</span>
            </div>
    </div>    
      <footer>
<a href="https://codepen.io/AjayBear/">
      <img src="https://cdn1.iconfinder.com/data/icons/simple-icons/256/codepen-256-black.png">
      <p>Check out my other pens</p>
    </a>
  </footer>  
  </body>
</html>
            
          
!
            
              body{
    
background: #212121;
    
}


#burger-container{
    position:relative;
    margin:100px auto;
    width:50px;
}


#burger{
    cursor:pointer;
    display:block;
}


#burger span{
    background: #ff216a;
    display:block;
    width:100px;
    height:14px;
    margin-bottom: 10px;
    position: relative;
    top:0;
    transition: all ease-in-out 0.4s;  
}

#burger-container.open span:nth-child(2),
#burger-container.open span:nth-child(3){
    width: 0;
    opacity:0;
    
}

#burger-container.open span:nth-child(1){

    transform: rotate(-45deg);
    top:36px;
}

#burger-container.open span:nth-child(4){
    transform: rotate(45deg);
    top:-36px;
}


footer{
  position:fixed;
  top:80%;
  width:100%;
  height:50px;
  right:auto;
  box-sizing:border-box;
  padding-right:50px;
}
footer img{
  height:50px;
  filter:invert(100%);
  float:left;
}
footer p{
  
    font-family: 'Righteous', cursive;
    font-size: 1.2em;
    margin-top:13px;
}
footer a{
  color:#fff;
  text-decoration:none;
  display:inline-block;
  width:250px;
  float:right;
  opacity:1;
  transition:.2s ease-in-out;
}
footer a:hover{
  opacity:.6;
  transition:.2s ease-in-out;
}


            
          
!
            
              $(document).ready(function(){
    $("#burger-container").on('click', function(){
        $(this).toggleClass("open");
    });
});
            
          
!
999px
Loading ..................

Console