Pen Settings



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


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.


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.


                <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 {
  background: #ddddff;
  width: 100%;
  height: 10em;
  position: relative;
  top: 0;
  left: 0;

.accordion.js > * {
  display: inline;

.accordion.js > * > h1 {
  cursor: pointer;
  visibility: visible;
  display: inline-block;
  float: left;
  margin: 0 1em 0 0;
  padding: 0.5em 0.5em;
  background: #ffdddd;;

.accordion.js > * > *:not(h1) {
  position: absolute;
  top: 3em;
  left: 1em;

.accordion.js > * > ul {
  top: 4.5em;

.accordion.js > *:not(.expanded) > *:not(h1) {
  opacity: 0;
  visibility: hidden;

.accordion.js > .expanded > *:not(h1) {
  opacity: 1;
  visibility: visible;

.accordion.js > * > *:not(h1) {
  transition: visibility 0.5s, opacity 0.5s;


                (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, currentTarget, i;
    targets = accordion.querySelectorAll('.accordion > * > h1');
    for(i = 0; i < targets.length; i++) {
      targets[i].addEventListener('click', function () {
        if (currentTarget)
        currentTarget = this.parentNode;
      }, 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++) {