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.

            
              <nav>
  <a href="#" id="toggle" class=""><span></span></a>
  <div id="menu" style="left: -2000px; opacity: 0;">
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">web design</a></li>
      <li><a href="#">édition</a></li>
      <li><a href="#">communication</a></li>
      <li><a href="#">photographies</a></li>
      <li class="contact1"><a href="designproduit.html">design produit</a></li>
    </ul>
  </div>
</nav>
<!-- Contenu de la page -->
<div id="content">
  <h1>Menu bar pour mobile</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit consectetur modi omnis aut illo, officiis numquam rerum. Doloribus dignissimos quo quis, vero cumque provident quae officia error, unde ducimus reiciendis!</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit consectetur modi omnis aut illo, officiis numquam rerum. Doloribus dignissimos quo quis, vero cumque provident quae officia error, unde ducimus reiciendis!</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit consectetur modi omnis aut illo, officiis numquam rerum. Doloribus dignissimos quo quis, vero cumque provident quae officia error, unde ducimus reiciendis!</p>
</div>
            
          
!
            
              #toggle {
  display: block;
  width: 45px;
  height: 30px;
  margin-top: 0px;
  margin-bottom: 2px;
  position: absolute;
}
#toggle span:after, #toggle span:before {
  content: "";
  position: absolute;
  left: 0;
  top: -9px;
}
#toggle span:after {
  top: 9px;
}
#toggle span {
  position: relative;
  display: block;
  top: 20px;
}
#toggle span, #toggle span:after, #toggle span:before {
  width: 100%;
  height: 3px;
  background-color: #FF6B6B;;
  transition: all 0.2s;
  border-radius: 2px;
}
#toggle.on span:before {
  transform: rotate(45deg) translate(5px, 5px);
  -webkit-transform: rotate(45deg) translate(5px, 5px);
  -moz-transform: rotate(45deg) translate(5px, 5px);
  -o-transform: rotate(45deg) translate(5px, 5px);
  -ms-transform: rotate(45deg) translate(5px, 5px);
}
#toggle.on span:after {
  transform: rotate(-45deg) translate(7px, -8px);
  -webkit-transform: rotate(-45deg) translate(7px, -8px);
  -moz-transform: rotate(-45deg) translate(7px, -8px);
  -o-transform: rotate(-45deg) translate(7px, -8px);
  -ms-transform: rotate(-45deg) translate(7px, -8px);
}
#toggle.on span {
  background-color: transparent;
}
#menu {
  margin: 0;
  padding: 0;
  position: absolute;
  opacity: 0.3;
  top:30px;
  width: 180px;
  left: -850px;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  border: 1px solid #FF6B6B;;
  border-bottom: none;
  margin-top: 25px;
  background-color: rgb(240,240,240); 
}
#menu ul {
  margin: 0;
  padding: 0;
}
#menu li {
  border-bottom: 1px solid #FF6B6B;;
  list-style-type: none;
}
#menu li a {
  display: block;
  height: 40px;
  line-height: 40px;
  text-align: center;
  text-decoration: none;
  color: #353943;
  font-family: 'Hammersmith One', sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.05em;
}
#menu li a:hover {
  opacity: 0.5;
}
/*
Contenu
*/

#content {
  padding: 60px;
  color: #353d46;
  font: 18px/27px 'Oxygen', sans-serif;
}
h1, h2, h3 {
  color: #FF6B6B;
  margin: 0 0 27px;
  line-height: 1em;
}
            
          
!
            
              (function() {
  var theToggle = document.getElementById('toggle'); // cible toggle
  var theMenu = document.getElementById('menu'); // cible menu
  theToggle.bol = false; // interrupteur sur toogle
  theToggle.addEventListener('click', function(event){
    event.returnValue = false;
    this.bol = !this.bol; // inversion logique
    if(this.bol){ // test sur la variable - si vrai
      this.className = "on"; // rajout de la class
      theMenu.style.left = 0; // chgt propriété left sur le menu
      theMenu.style.opacity = 1; // chgt propriété opacity sur le menu
    }else{ // si faux
      this.className = ""; // remove class
      theMenu.style.left = '-2000px';
      theMenu.style.opacity = 0;
    }
  })
}).call(this);
            
          
!
999px
Loading ..................

Console