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


                <div class="container">
<dl class="accordion">
  <dd>Another modern browser. Extra UI stuff around the edges. Fancy wheel hubcaps.</dd>
  <dd>A browser known for its quirks, but getting better.</dd>
  <dd>A really awesome browser. Another name for a red panda.
      <dt>Duck Duck Go</dt>
      <dd>A search engine that doesn’t follow you
around with ads. They don’t store your search history. Therefore, they have nothing to sell to advertisers that track you across the Internet.
          <dt>Where do I get it?</dt>
          <dd>Go to <a href=""></a></dd>
</div><!-- container -->


                .container { width: 80%;margin: 1em auto;}
dt {
  font-weight: bold;
.accordion {
  margin: 1em 0;
.accordion dt {
  color: #333;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  padding: .5em 1em;
  margin-top: .5em;
.accordion dd {
  margin: 0;
  margin-bottom: .5em;
  padding: .5em 1em;
  border: 1px solid #ddd;
  border-top-left-radius: 0;  
  border-top-right-radius: 0;
  border-top: none;
  display: block;
.accordion dt:hover,
.accordion dt:active {
  background-color: #e5e5e5;

/* interactivity using aria-state expanded */
.js.accordion dt { cursor: pointer;}
.js.accordion dd[aria-expanded=false] { opacity: 0; display: none; } /* hide using js */ 
.js.accordion dd[aria-expanded=true] { display: inherit; }



                (function () {
  var accordions, contents, i;
  // Make sure the browser supports what we are about to do.
  var supports = !!document.querySelector && !!window.addEventListener;

  if ( !supports ) {
  } else {
    // Using a function helps isolate each accordion from the others
    function makeAccordion(accordion) {
      var targets, currentTarget, i;

      targets = accordion.querySelectorAll('.accordion dt');
      contents = accordion.querySelectorAll('.accordion dd');

      for(i = 0; i < contents.length; i++) {
        if(!(contents[i].getAttribute('aria-expanded') === 'true')){
      for(i = 0; i < targets.length; i++) {
        if(targets[i].nextElementSibling.getAttribute('aria-expanded') === 'true'){
          targets[i].style.borderBottomLeftRadius = 0;
          targets[i].style.borderBottomRightRadius = 0;
        targets[i].addEventListener('click', function () {

          if(this.nextElementSibling.getAttribute('aria-expanded') === 'true'){
    = "0.5em";            
          } else {  
   = 0;
   = 0;
        }, false);


    // Find all the accordions to enable
    accordions = document.querySelectorAll('.accordion');
    for(i = 0; i < accordions.length; i++) {