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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                 <nav>
    <ul>
      <li><a href="#">Home</a></li><!--
   --><li><a href="#">Folio</a></li><!--
   --><li><a href="#">References</a></li><!--
   --><li><a href="#">Contact</a></li>
    </ul>
  </nav>
<div class="container">
  <h1>Menu fixe</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?
 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?
 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima omnis neque deserunt quam quidem incidunt sequi fugiat placeat quas vitae et cumque minus vero mollitia animi atque natus. Aliquid obcaecati?</p>
</div>

<footer>
 
</footer>

</body>
              
            
!

CSS

              
                
.container {
  width: 600px;
  margin: 0 auto 60px auto; /* Ajout d'une marge en bas de 60px pour éviter que le footer ne superpose le bas du .container */
  font-family: sans-serif;
  font-size: 1rem;
  margin-top:4rem;
}

body > nav {
  /* Le footer est positionné en fixed en bas de page, et ses bords collent à l'extrême gauche et l'extrême droite de la page */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  
  background-color: rgba(0, 0, 0, .9);
  border-bottom: 2px solid gray;
}

 nav > ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center; /* Cela va aligner les éléments du menu au centre (vu qu'ils sont en 'inline-block') */
}

 nav > ul > li {
  display: inline-block;
}

nav > ul > li > a:link,
 nav > ul > li > a:visited
{
  display: block;
  padding: 1rem;
  color: #fff;
  font-family: sans-serif;
  font-size: 1rem;
  text-decoration: none;
  /* Ajout de bordures à gauche et à droite de chaque élément de menu (pour simuler les lignes de séparation) */
  border-right: 1px solid #111;
  border-left: 1px solid #222;
}
 nav > ul > li > a:hover,
 nav > ul > li > a:active,
 nav > ul > li > a:focus {
  background-color: black;
}

/* Suppression des bordures à gauche pour le 1er élément et à droite pour le dernier élément de menu. */
 nav > ul > li:first-child > a {
  border-left: none;
}
 nav > ul > li:last-child > a {
  border-right: none;
}
              
            
!

JS

              
                
              
            
!
999px

Console