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>
  <ul class="top-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#">Restaurants</a>
      <ul class="sub-nav">
        <li><a href="#">Limoncello</a></li>
        <li><a href="#">Svago</a></li>
        <li><a href="#">Spasso Milano</a></li>
        <li><a href="#">Weissbrau</a></li>
        <li><a href="#">AKA Chochin</a></li>
        <li><a href="#">BLANK</a></li>
      </ul>
    </li>
    <li><a href="#">Functions</a></li>
    <li><a href="#">Offers</a></li>
    <li><a href="#">Contact Us</a></li>
  </ul>
</nav>

              
            
!

CSS

              
                

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;  
}
nav {
  max-width:85%; /* an arbitrary width */
  margin: 0 auto; /* center the elements */
}

nav {
  margin-top:50px; /* just a little bit of margin */
  background: ;  
}

.top-nav {
  font-size:0; /* eliminates whitespace from inline-block*/
  float:right;
  width:85%;
}

.top-nav li {
  display:inline-block; /* blocks just line up without floats */
  width:18%; /* Just a number */
  background: #AD814C;  
  position:relative; /* sets positioning context for 2nd level menu */
}

.top-nav li a{
  padding:10px;
  font-family:Tahoma, Geneva, sans-serif;
  text-transform:uppercase;
  
}


.top-nav > li a {
  text-decoration:none; /* removes underline */
  font-size:24px; /* re-establish a font-size */
  line-height:1.5em; /* centers the text vertically*/
  text-align:center; /* centeres the text horizontally */
  display:block; /* links now fill the block*/
  color:#fff; 
    font-size:small;
}


.top-nav > li > a {
  /* groove type border effect */
  border-left: 1px solid #fff; 
  /*border-right: 1px solid #3c3c3c;
  border-bottom: 1px solid black;
  border-top: 1px solid #3c3c3c;*/
}


.top-nav > li > a:hover,
.sub-nav > li > a:hover{
  /* hover color for links */
   background: #8C693C;
       /*TRANSISTIONS*/
    -webkit-transition: background 0.5s ease;
       -moz-transition: background 0.5s ease;
         -o-transition: background 0.5s ease;
        -ms-transition: background 0.5s ease;
            transition: background 0.5s ease;
}

.sub-nav { /* just a class name for 2nd level menus */
  position:absolute;
/* positions the menu UNDER the list item*/
  width:100%; 
/* makes the width of the menu the same as the list item */
  visibility:hidden; 
/* hides the menu until needed */
  
}

.top-nav li:hover .sub-nav {
  visibility:visible; 
/* shows the submenu when the list item is hovered */
  
}

.sub-nav > li, .sub-nav > li a{
  display:block;
  width:100%;
  position:relative; 
/* sets positioning context for 3rd level menu */
  background:#AD814C; 
/* something different for example */
  color:#fff;
}

.sub-nav > li > a {
  /* jsut some styling */
  border-top: 1px solid #fff;
}

.sub-nav > li:last-child a {
  border-bottom: none;
}

              
            
!

JS

              
                
              
            
!
999px

Console