Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!-- This demo uses float grid but you can use flex grid too -->

<div class="row">
  <div class="columns">
    <h2>Accordion Menu</h2>
    <p>Accordion menus follow the basic <a href="menu.html">Menu</a> syntax of <code>&lt;ul&gt;</code>, <code>&lt;li&gt;</code>, and <code>&lt;a&gt;</code>. To convert a basic menu into an accordion, add the attribute <code>data-accordion-menu</code>. You probably also want it to be vertical, so add the class <code>.vertical</code> as well.</p>
    <p>Any <code>&lt;a&gt;</code> will behave like a standard link. However, any <code>&lt;a&gt;</code> paired with a nested <code>&lt;ul&gt;</code> menu will then slide that sub-menu up and down when clicked on.</p>
    <div class="primary callout">
      <p>You can use the built-in <code>.nested</code> class to add an indent to a nested menu.</p>
    </div>

    <div class="primary callout">
      <p>To have a sub-menu already open when the page loads, add the class <code>.is-active</code> to that sub-menu.</p>
    </div>
  </div>
</div>

<div class="row">
  <div class="columns">
    <ul class="vertical menu" data-accordion-menu style="max-width: 250px">
      <li>
        <a href="#">Item 1</a>
        <ul class="menu vertical nested">
          <li>
            <a href="#">Item 1A</a>
            <ul class="menu vertical nested">
              <li><a href="#">Item 1Ai</a></li>
              <li><a href="#">Item 1Aii</a></li>
              <li><a href="#">Item 1Aiii</a></li>
            </ul>
          </li>
          <li><a href="#">Item 1B</a></li>
          <li><a href="#">Item 1C</a></li>
        </ul>
      </li>
      <li>
        <a href="#">Item 2</a>
        <ul class="menu vertical nested">
          <li><a href="#">Item 2A</a></li>
          <li><a href="#">Item 2B</a></li>
        </ul>
      </li>
      <li><a href="#">Item 3</a></li>
    </ul>
  </div>
</div>



              
            
!

CSS

              
                /* Demo Styles */

body {
  padding: 2rem 1rem;
}
              
            
!

JS

              
                $(document).foundation();
              
            
!
999px

Console