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

              
                <div class = "container">
  <div class = "nav-container">
    <ul id="navmenu">
      <li><a href="#"><span class = "entypo-home"></span><span class = "nav-link">Home</span></a></li>
      <li><a href="#"><span class = "entypo-lamp"></span><span class = "nav-link">About</span></a></li>
      <li><a href="#" id = "submenu"><span class = "entypo-book-open"></span><span class = "nav-link">Products</span></a>
        <ul id = "drop" >
          <li><a href="#">Widgets</a></li>
          <li><a href="#">Thingamabobs</a></li>
          <li><a href="#">Doohickies</a></li>
        </ul>
      </li>
      <li><a href="#"><span class = "entypo-mail"></span><span class = "nav-link">
        Contact</span></a></li>
    </ul>
  </div>
  
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. 
  </p>
</div>
              
            
!

CSS

              
                @import url(http://weloveiconfonts.com/api/?family=entypo);
/*reset*/ul{list-style:none;}a{text-decoration:none;}ul,li,a{margin:0;padding:0;}

/***** basic styles *****/

body { background: #E0E0E0 url('https://subtlepatterns.com/patterns/creampaper.png');}

.container {
  position: relative;  	
  width: 800px;
  margin: 30px auto;
}

.nav-container {
  width: 650px;
  margin: 0 100px;
}

p {
  font-family: Georgia;
  color: #333;
}

a {
  font-family: 'Helvetica', 'Arial', san-serif;
  color: #333;
}

/***** menu *****/
#navmenu {  
  display: inline-block;
  height: 30px;
  padding: 5px 0;
  
  border: solid 1px #A3A3A3;
  border-radius: 7px;
  box-shadow:  2px 2px 5px #ccc;
}

#navmenu > li { 
  border-color: #ADADAD;
  
  border-right: solid 1px #A3A3A3; 
  padding: 0 10px;
}

#navmenu li {
  float: left;
  position: relative;
  line-height: 30px; /* must match height of ul */
}

#navmenu li:hover span { color: #C89292; }
.nav-link {
  display: inline;
  margin: 0 10px 0 50px;
}

/* icon font */
[class*="entypo-"] { font-family: 'Entypo', sans-serif; }

#navmenu span[class*="entypo-"] {
  position: absolute;
  left: 15px;
  
  color: #8f8f8f;
  font-size: 1.5em;
}

/***** submenu *****/

/* submenu container */
#drop {
  opacity: 0;
  position: absolute;
  top: 35px;
  left: 0px;
  width: 150px;
  background: #333;
}

/* submenu links */
#drop li a { 
  background: #333; 
  color: #E0E0E0;
  font-size: 0.8em;
  margin-left: 10px;
}

/* height of submenu links */
#navmenu li:hover ul li {
  height: 30px;
  line-height: 30px;
}

/* submenu positioning */
#navmenu li:hover ul { opacity: 1; }
#drop li {
  float: none;
  position: static;
  height: 0;
  line-height: 0;
  background: none;
}

/* submenu transitions */
#navmenu li { transition: all 0.2s; }
#navmenu li a { transition: all 0.5s; }
#drop { transition: all 1s; }
#drop li { transition: height 0.5s; }
              
            
!

JS

              
                // CSS Styling by me

// Dropdown menu code from:
// http://www.gethifi.com/blog/nicer-navigation-with-css-transitions


//Allow clicking instead of hover for the dropdown menu
$(document).ready( function(){

    $('#submenu').click( function(event){
        event.stopPropagation();
        $('#drop').toggle();
    });
    
    $(document).click( function(){
        $('#drop').hide();
    });
  
});

    
              
            
!
999px

Console