Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <nav id="LeMenu">
  <a href="#">Nous rejoindre</a>
  <a href="#">Recherche</a>
  <a href="#">Le Blog</a>
  <a href="#">Notre Métier</a>
  <a href="#">Photos</a>
  <a href="#">Coups de Coeur</a>
  <a href="#">Evènements</a>
</nav>
<div id="CmdMenu" title="Afficher/Masquer le Menu">&#9776;</div>
            
          
!

CSS

            
              /* MENU */
#LeMenu { 
  max-width:1400px; 
  margin:0 auto;
  display:flex;
  justify-content:center;
}
#LeMenu > a { 
  padding:5px 15px; 
  margin:0 5px;
  text-decoration:none;
  font: 1em Arial, Helvetica, sans-serif;
  text-transform:uppercase; /* en majuscules */
  color:#fff;
  border:solid 1px #fff;	
  background: #577bac;
  border-radius:30px;
  text-align:center;
}
#LeMenu > a:hover {	
  background:#ffaaaa; 
  color: #577bac;	
  border: solid 1px #577bac;
}

/* bouton menu burger */
#CmdMenu { 
  position :fixed; 
  top :4px; 
  right :4px; 
  z-index :50;
  padding:5px 8px; 
  color:#fff;
  background: #577bac;
  border-radius:5px;
  cursor:pointer;
}
#CmdMenu:hover {	
  background:#ffaaaa; 
  color: #577bac;	
  border: solid 1px #577bac;
}

/* MOBILE FIRST */
#LeMenu {
  flex-direction:column;
}
#CmdMenu { 
  display:block;
}
/* TABLET - DESKTOP */
@media (min-width: 769px) {
  #LeMenu {
    flex-direction:row;
    /*flex-wrap:wrap;*/
  }
  #LeMenu > a {
    display:flex;
    align-items:center;
    /*flex-wrap:wrap;*/
  }
  #CmdMenu { 
    display:none;
  }
}
/* TABLET */
@media (min-width: 769px) and (max-width: 1200px) {
  #LeMenu > a { 
    padding:5px 10px; 
    margin:0 2px;
  }
}
/* DESKTOP */
@media (min-width:1201px) {
  #LeMenu > a { 
    margin:0 5px;
  }
}

            
          
!

JS

            
              
"use strict";
window.addEventListener("DOMContentLoaded", (event) => {
  /* MENU */
  const LeMenu = document.getElementById("LeMenu");
  const CmdMenu = document.getElementById("CmdMenu");
  CmdMenu.addEventListener('click',function(){
    LeMenu.style.display = (LeMenu.style.display == 'none')? '':'none';
  });
  // au chargement de la page
  window.onload = function(){
    // on teste la largeur de la fenêtre
    var ww = window.innerWidth; // en pixels
    LeMenu.style.display = ( ww > 768 )? '':'none';
    CmdMenu.style.display = ( ww > 768 )? 'none':'';
  };
  // au redimensionnement de la fenêtre
  window.onresize = function(){
    // on teste la largeur de la fenêtre
    var ww = window.innerWidth; // en pixels
    LeMenu.style.display = ( ww > 768 )? '':'none';
    CmdMenu.style.display = ( ww > 768 )? 'none':'';
  };

});
            
          
!
999px

Console