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

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.

HTML

              
                <div class="accordion">
  <div class="accordion-header">
    <h2>Hover Me!</h2>
  </div>
  <div class="accordion-body">
    Lorem ipsum, dolor sit amet consectetur adipisicing elit. Suscipit
    provident nihil placeat a ipsa voluptas dolores quo harum maxime aut
    itaque aliquam earum sed, ad, accusantium quas dignissimos asperiores
    odio! Quas voluptatem dolorem ratione harum fugiat, pariatur laudantium
    eligendi nostrum, veniam et, sed officia minus quasi! Inventore
    accusamus neque laudantium tenetur accusantium fuga ea optio
    reprehenderit sapiente quam. Quisquam, distinctio. Vel, at quo facilis
    nihil assumenda laboriosam eius earum aspernatur labore quasi veniam
    beatae sequi. Incidunt delectus magnam et quasi tempore soluta,
    perspiciatis distinctio quae, sed dolores in quas eveniet? Tempora
    delectus suscipit consequuntur esse sapiente pariatur voluptas dolor sit
    error consectetur illum quas iure, distinctio velit est maxime dicta
    fuga, itaque, sed praesentium? Animi dolorem laudantium sequi quam
    debitis? Quia dolorem perspiciatis a! Reiciendis quidem, repudiandae
    optio, sed illo ad distinctio minima et maiores velit cumque! Molestias
    libero expedita id saepe. Quos aliquam aperiam, unde architecto
    consequatur tenetur magnam. Possimus id molestias, facere fugit dolor
    fugiat aut ut, et, excepturi suscipit ad voluptate beatae at eligendi
    libero quis? Cumque sequi quasi delectus facilis ex vitae laboriosam
    expedita placeat error. In, molestiae eius omnis assumenda perferendis
    sunt suscipit excepturi? 
  </div>
</div>
              
            
!

CSS

              
                * {
  padding: 0;
  margin: 0;
}
body {
  display: grid;
  place-content: center;
}
.accordion {
  width: 300px;
  border-bottom: greenyellow solid 10px;
  background-color: #000;
  color: #fff;
}
.accordion-header {
  padding: 10px;
  cursor: pointer;
  font-size: 26px;
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 10px;
  transition: max-height 0.5s ease;
}
.accordion:hover .accordion-body {
  max-height: 300px;
}
              
            
!

JS

              
                
              
            
!
999px

Console