Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

HTML

              
                <details>
  <summary>What's the secret to life?</summary>
  <div class="content">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sit earum temporibus sed dolorem, facere aspernatur natus iste amet. Doloremque nobis error ut, facilis quasi ipsum accusamus quae perferendis quaerat asperiores.
  </div>
</details>

<details>
  <summary>This is another title, with a very long line character count, maybe this is a problem for some?</summary>
  <div class="content">
    <p>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sit earum temporibus sed dolorem, facere aspernatur natus iste amet. Doloremque nobis error ut, facilis quasi ipsum accusamus quae perferendis quaerat asperiores.
    </p>
    <p>
      Adi voluptate quam ex, aliquam ut fuga rerum delectus totam molestiae dolores accusamus at modi!
    </p>
  </div>
</details>

<details>
  <summary>System requirements</summary>
  <div class="content">
    <ul>
    <li>OS: Windows 7, Windows 8, 8.1, Windows 10</li>
    <li>Processor: Intel core i5 2557M</li>
    <li>Memory: 4 GB RAM</li>
    <li>Graphics: GeForce GT440 or HD5570</li>
    <li>Storage: 1 GB available space</li>
  </ul>
  </div>
</details>
              
            
!

CSS

              
                body {
  margin: 20px;
  max-width: 700px;
}

details {
  border-top: 4px solid #e2e2e2;
  border-bottom: 4px solid #e2e2e2;
  padding: 0.5em 0.5em 0;
  color: #333;
  
  .content {
    line-height: 1.5;
  }
}

details + details {
  margin-top: 30px;
}

summary {
  position: relative;
  font-weight: bold;
  margin: -0.5em -0.5em 0;
  padding: 1.25em 2em 1.25em .5em;
  cursor: pointer;
  font-size: 1.2rem;
  list-style: none;

  &:focus {
    outline: none;
    box-shadow: inset 0 0 2px 2px rgba(66, 153, 225, 0.4);
  }
}

details[open] {
  padding: 0.5em;
}

details[open] summary {
  margin-bottom: 0.5em;

  &:after {
    transform: rotate(180deg);
  }
}

summary:after {
  width: 20px;
  right: 35px;
  background-image: url("data:image/svg+xml,%0A%3Csvg width='20' height='12' viewBox='0 0 20 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 11.3907C9.66887 11.3907 9.33775 11.2583 9.07285 10.9934L0.397351 2.31788C-0.13245 1.78808 -0.13245 0.993379 0.397351 0.463578C0.927152 -0.0662236 1.72185 -0.0662236 2.25165 0.463578L10 8.1457L17.7484 0.397351C18.2782 -0.13245 19.0728 -0.13245 19.6026 0.397351C20.1325 0.927152 20.1325 1.72185 19.6026 2.25166L10.9271 10.9272C10.6622 11.2583 10.3311 11.3907 10 11.3907Z' fill='%23737373'/%3E%3C/svg%3E%0A");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  top: 0;
  right: 10px;
  width: 18px;
  content: " ";
  height: 100%;
  float: none;
  display: block;
  transition: 0.2s;
}

summary::-webkit-details-marker {
  display: none;
}
              
            
!

JS

              
                    
              
            
!
999px

Console