Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

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

              
                <main>
  <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Sequi, at odit. Dolores reiciendis excepturi repellat!</p>
  <details open>
    <summary>Table of Contents</summary>

    <div class="toc-contents">
      <ul>
        <li><a href="">Item 1</a></li>
        <li><a href="">Item 2</a></li>
        <li><a href="">Item 3</a></li>
        <li><a href="">Item 4</a></li>
        <li><a href="">Item 5</a></li>
        <li><a href="">Item 6</a></li>
        <li><a href="">Item 7</a></li>
        <li><a href="">Item 8</a></li>
      </ul>
    </div>
  </details>
  <p>Repellendus, officiis error nisi, dolorum, eos vitae consectetur veritatis similique voluptatum sint dignissimos dolores molestias!</p>
  <p>Earum, adipisci ad. Debitis ipsa beatae a quaerat dolore optio possimus nulla praesentium eveniet pariatur?</p>
  <p>Nostrum reiciendis aperiam consectetur neque, sit voluptatum, distinctio modi architecto eius id, commodi porro! Asperiores.</p>
  <p>Error quis, corporis vitae dolores veritatis perspiciatis id impedit quod nostrum, incidunt sed explicabo minima!</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora magnam sit, deserunt dolorum provident inventore laboriosam?</p>
  <p>Aspernatur, eos at possimus saepe illum molestias ad tenetur debitis quas error illo voluptate amet asperiores.</p>
  <p>Magni voluptates consectetur iure nihil voluptas dicta pariatur, distinctio nostrum! Modi esse aperiam quae ipsam voluptatum!</p>
  <p>Officiis dolores sit quisquam tempore in molestiae nemo error. Quasi corporis culpa molestiae deleniti ullam itaque.</p>
  <p>Delectus, vitae? Nostrum, ex. Quam corrupti dignissimos velit eligendi perferendis omnis alias maxime itaque laudantium laboriosam.</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Autem nemo qui dolorum, pariatur corporis modi eum a explicabo unde placeat, laborum accusantium. Officiis cumque rerum pariatur accusamus delectus quos amet?</p>
  <p>Sit iure porro ullam in perspiciatis adipisci placeat magnam deserunt et? Harum consequuntur eaque facilis quos tempore ipsam, impedit explicabo repellat qui eligendi nulla esse? Perferendis at suscipit recusandae mollitia?</p>
  <p>Consequatur veniam, saepe pariatur ratione fugiat a ducimus eius autem! Fugiat molestias aspernatur, vero cupiditate odio quia aut facere repellendus, maxime debitis repellat officia ipsam quibusdam sed voluptatibus officiis adipisci.</p>
  <p>Eveniet assumenda soluta rerum labore molestiae sapiente, vel dolores veritatis harum consequatur impedit? Quaerat reiciendis error deleniti? Obcaecati, quibusdam! Tempora cupiditate alias officia. Rerum in vel voluptate quos, itaque facilis.</p>
  <p>Nemo, delectus, hic aliquam laudantium voluptates, tenetur eligendi pariatur molestias eaque odio commodi voluptatibus cum. Sint, omnis. Alias expedita iste doloremque, a quisquam voluptatum soluta magnam aspernatur facilis inventore omnis?</p>
  <p>Totam, rem ducimus fuga animi esse iusto! Quas corrupti eligendi sequi maiores pariatur ad esse, doloremque quae placeat. Nisi assumenda dolor sunt. Pariatur nesciunt ex minus unde mollitia, ratione eos.</p>
  <p>Eos voluptas fugiat nulla non commodi iure dicta molestias ipsum corporis. Autem nisi veritatis quam provident, repellat accusantium numquam quia minus excepturi, laboriosam tenetur. Odio dolorem consequatur alias unde? Magnam?</p>
  <p>Nam doloremque non magni aperiam dicta mollitia ducimus? Voluptatem earum, id natus reiciendis minima a obcaecati laboriosam dolorum ipsa nulla assumenda hic animi ex fuga? Eligendi obcaecati libero provident neque.</p>
</main>
              
            
!

CSS

              
                .toc-contents {
  overscroll-behavior: contain;
  max-height: 5.5em;
  overflow-y: auto;
}

details {
  float: left;
  margin-right: 1rem;
  padding: 1rem;
  box-shadow: 0 0 8px -2px hsl(0 0% 45%);
  border-radius: 0.5rem;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font-family: system-ui;
  line-height: 1.5;
  padding: 5vmin;
}

main {
  max-width: 60ch;
  margin-inline: auto;
}

main > * + * {
  margin-top: 1em;
}

              
            
!

JS

              
                
              
            
!
999px

Console