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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="nav-primary" id="nav">
  <ul class="nav-primary_menu">
    <li class="active nav-primary_menu_item" ><a href="#0">home</a></li>
    <li class="nav-primary_menu_item"><a href="#0">about</a></li>
    <li class="nav-primary_menu_item"><a href="#0">projects</a></li>
    <li class="nav-primary_menu_item"><a href="#0">blog</a></li>
    <li class="nav-primary_menu_item"><a href="#0">contact</a></li>
  </ul>
</nav>

              
            
!

CSS

              
                .nav-primary_menu {
  text-decoration: none;
  margin: 0;
  background-color: rgba(0,0,0,.75);
}

.nav-primary_menu li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.nav-primary_menu .active a,
.nav-primary_menu li a:hover {
  outline: 1px dotted salmon; /* this rule works because:
  1. although it is defined earlier in the cascade than the next rule, 
  2. it is more specific than the next rule */ 
}

.nav-primary_menu li a {
  text-decoration: none;
  display: inline-block;
  color: white;
  padding: .5em;
  outline: none; /* see previous rule: this rule has no effect on the active link */
}

.nav-primary_menu .active a,
.nav-primary_menu li a:hover {
  color: teal; /* this rule works because:
  1. it is defined further down in the cascade and 
  2. it is more specific than the previous rule */ 
  /* background-color: azure; */
}

/* more examples on cascade and specificity */
.nav-primary_menu .nav-primary_menu_item {
  background-color: transparent; 
}

.nav-primary_menu li {
  background-color: azure; /* this rule will have no effect because:
  1. althought it is defined further down in the cascade, 
  2. it is less specific than the previous rule */ 
}

.nav-primary_menu .active {
  background-color: azure; /* this rule works because:
  1. it is defined further down in the cascade, 
  2. although it has the same specificity as the previous rule */ 
}

/* general */
html,
body {
  min-height: 100%;
  background-color: azure;
}

body {
  margin: 0;
}

.nav-primary_menu .active a {
  pointer-events: none;
  cursor: default;
}


              
            
!

JS

              
                
              
            
!
999px

Console