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="xs-12 lg no-margin">
  <div class="xs-left">
    <div class="brand">
      <span><a class="no-pad xs-pad-0-1" href="#"><i class="fa fa-ellipsis-v"></i></a> Brand</span>
    </div>
  </div>
  <div class="xs-right" id="my-menu">
    <a href="#" menu-toggle="my-menu"><span class="fa fa-bars"></span></a>
    <a class="active" href="#">Home</a>
    <a href="#">About us</a>
    <a href="#">Contact Us</a>
    <a href="#">Other</a>
  </div>
</nav>

<nav class="xs-12 sm no-margin">
  <div class="xs-right" id="new-menu">
    <a href="#" menu-toggle="new-menu"><span class="fa fa-bars"></span></a>
    <a href="#">Home</a>
    <a href="#">About us</a>
    <a href="#">Contact Us</a>
    <a href="#">Other</a>
  </div>
</nav>

<div class="xs-12 sm-12 md-12 lg-12" id="content">
  <h1 class="font-size-4 text-secondary">The Easy Menus</h1>
  <p>Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet.</p>
  <p>Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet.</p>
  <p>Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet. Lorem ipsum dolar sit amet.</p>
</div>
              
            
!

CSS

              
                // create the list of screen sizes
screen-sizes = ( xs sm md lg xl )

// define screen widths
xs_width = 0px
sm_width = 544px
md_width = 768px

// config for the max screen size to display the mobile menu toggle
mobile-menu-active = md

// hide mobile menu toggles by default
[menu-toggle]
  display: none
    
// if screen is smaller than the set mobile menu active setting
@media screen and (max-width: mobile-menu-active+'_width')
  // default style of mobile menu toggle 
  [menu-toggle]
    display: inline-block
  
  nav :not(.brand) > div
    float: left

  // while display is in realm of defined mobile menu widths, create the scene for mobile display.
  nav
    a[menu-toggle]
      float: right
    & :not(.brand)
      a
        text-align: center
        width: 100%
      [menu-toggle]
        float: none
      a:not([menu-toggle])
        display: none
        margin: 0
      
              
            
!

JS

              
                // when a menu toggle has been clicked
$('[menu-toggle]').click(function() {
  
  // get menu name by link 'menu-toggle' attribute
  menu = $(this).attr('menu-toggle');
  
  // show the targetted toggle menu
  $('nav #'+menu+' a:not("[menu-toggle]")').slideToggle();
  
});
              
            
!
999px

Console