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

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console