Pen Settings



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


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


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.


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.


  <button data-expandable="section-name">Title of section</button>
<p id="section-name">Section content tincidunt turpis nec ultrices tristique. Aliquam bibendum metus dignissim dui placerat, sed porta urna blandit. Ut condimentum magna sit amet nulla finibus vestibulum. Maecenas maximus leo sed neque ornare, eu semper urna aliquam. Nam luctus enim eros, vel lacinia dolor tincidunt ut. Aenean laoreet pretium blandit.</p>



                body {
  max-width: 700px;
  padding: 1.6em;
  font-size: 120%;

/* style the expandable's button */
[data-expandable] {
  display: block;
  width: 100%;
  text-align: left;
  background: #293352;
  border: 0;
  color: #fff;
  padding: 0.25em 0.5em;
  margin-bottom: 0.25em;

/* make sure there is a focus style for keyboard accessibility */
[data-expandable]:focus {
  outline: 2px solid #005C9C;
  outline-offset: 1px;

/* the arrow using pseudo-content and unicode */
[data-expandable][aria-expanded="false"]::before {
  content: '\25b8\0020';
/* the arrow for the expanded state using pseudo-content and unicode */
[data-expandable][aria-expanded="true"]::before {
  content: '\25bE\0020';

/* pair visual appearance with accessible state  */
.expandable[aria-hidden="true"] {
  display: none;


  jQuery a11yExpandable plugin
  @name jquery.a11yExpandable.js
  @author Heydon ( or @heydonworks)
  @version 1.0
  @date 01/01/2013
  @category jQuery Plugin
  @copyright (c) 2015 (Heydon Pickering)
  @license Licensed under the MIT ( license.

(function( $ ) {
  $.fn.a11yExpandable = function() {
    return this.each(function() {
      var elem = $(this);
      var plugin = this;
      // set the ARIA state and relationship attributes
        'aria-expanded': 'false',
        'aria-controls': elem.attr('data-expandable') 
      // find the element to expand by id
      var expandable = $('#'+elem.attr('data-expandable')).attr({
        'aria-hidden': 'true',
        'class': 'expandable'
      // click handler
      elem.on('click', function() {
        // Cast the expanded state as a boolean
        var expanded = $(this).attr('aria-expanded') === 'false' ? false : true;
        // Switch the states of aria-expanded and aria-hidden
        elem.attr('aria-expanded', !expanded);
        expandable.attr('aria-hidden', expanded);
}( jQuery ));