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. 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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <section class="accordion">
    <p>I was sick yesterday, so not much happened.</p>
    <p>I have a bunch of things to do today:</p>
      <li>Grocery shopping</li>
      <li>Stop at the bank</li>
      <li>Dinner and a movie</li>
    <h1>Road Blocks</h1>
    <p>I'm sick!<p>



                .accordion.js > * {
  overflow: hidden;

.accordion.js > *:not(.expanded) > *:not(h1) {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  visibility: hidden;

.accordion.js > .expanded > *:not(h1) {
  max-height: 10em;
  opacity: 1;
  visibility: visible;

.accordion.js > * > h1 {
  cursor: pointer;
  visibility: visible;

.accordion.js > * > *:not(h1) {
  transition: max-height 1s,
    visibility 1s,
    margin 1s,
    opacity 1s;


                (function () {
  var accordions, i;
  // Make sure the browser supports what we are about to do.
  if (!document.querySelectorAll || !document.body.classList) return;
  // Using a function helps isolate each accordion from the others
  function makeAccordion(accordion) {
    var targets, i;
    targets = accordion.querySelectorAll('.accordion > * > h1');
    for(i = 0; i < targets.length; i++) {
      targets[i].addEventListener('click', function () {
          this.parentNode.classList.contains('expanded') ? 'remove' : 'add'
      }, false);


  // Find all the accordions to enable
  accordions = document.querySelectorAll('.accordion');
  // Array functions don't apply well to NodeLists
  for(i = 0; i < accordions.length; i++) {