Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


  <ul class="navbar" id="navbar">
    <li><a href="#">Home</a></li>
    <li><a href="#">Profile</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Contacts</a></li>
    <a class="close" href="#">
      <img src="" alt="close">
  <a class="hamburger" href="#navbar">
      <img src="" alt="menu">


                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* border: 1px solid red; */

body {
  /* background is white by default but added for clarity */
  background: white;
  width: 100%;

.hamburger, .close {
  border: none;
  cursor: pointer;
  /* position absolute position the icons relative to the body because they have no position relative parents*/
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;

.hamburger {
  background: white;

.close {
  background: black;

.hamburger img, .close img {
  width: 100%;
  height: 100%;

.navbar {
  position: absolute;
  /* a higher z-index put navbar above hamburger */
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  /* basic menu styling*/
  list-style: none;
  background: black;
  display: flex;
  flex-flow: column nowrap;
  justify-content: space-evenly;
  align-items: center;
  /* animate slide up/down */
  transform: translateY(-100%);
  transition: transform 0.2s ease;

/* :target is called when its anchor id #navbar is called by clicking on the hamburger which has href="#navbar" */

.navbar:target {
  /* show navbar */
  transform: translateY(0);

li a {
  display: block;
  font-family: 'Open Sans', sans-serif;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  /* remove default underline and add our own with padding and border bottom */
  text-decoration: none;
  border-bottom: 1px solid black;
  padding-bottom: 0.5rem;

li a:hover, li a:focus {
  /* show border bottom */
  border-bottom: 1px solid white;