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="wrapper">
<div class="plus">
  <h2>Lorem ipsum dolor?</h2>
  <div class="hide">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates ducimus, cumque fugit harum voluptatum consectetur impedit ullam, et quisquam eum.</p>
    <p>Incidunt vel impedit accusantium voluptatum possimus maxime nesciunt, laboriosam iusto adipisci corporis, ab voluptatem natus nulla. Nisi quis repellendus at!</p>
  </div>
</div>
<div class="plus">
  <h2>Nisi ipsa facere?</h2>
  <div class="hide">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta ipsam, voluptatum illum sed optio enim ea mollitia possimus accusantium animi.</p>
    <p>Qui, iure eius modi debitis, voluptates officia, animi inventore fugit accusantium sunt esse quos doloremque minima odit optio repellat in!</p>
  </div>
</div>
<div class="plus">
  <h2>Fuga atque voluptas?</h2>
  <div class="hide">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad suscipit ullam iure porro ab optio beatae eaque consequuntur dolor quos.</p>
    <p>Vitae, architecto, totam. Ad quas aut autem, voluptatem quibusdam voluptas vitae sed, tempora enim cum harum numquam blanditiis quod adipisci.</p>
  </div>
</div>
<div class="plus">
  <h2>Nemo nobis iusto?</h2>
   <div class="hide">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis ratione, ut laborum quae. Laudantium incidunt, officia recusandae? Id, excepturi, sequi!</p>
    <p>Voluptatibus ducimus molestiae a, praesentium dignissimos optio culpa iusto, deleniti labore. Ullam assumenda, dicta nulla, voluptate quas possimus ut nemo!</p>
  </div>  
</div>
</div>
              
            
!

CSS

              
                body {font: 14px Geneva, Verdana, sans-serif;}
.wrapper {
  width: 90%;
  margin: 20px auto;
}
.plus {
 background: url(https://html-plus.in.ua/wp-content/uploads/2016/04/plus.png) no-repeat 0 6px;
  padding: 10px;
  padding-left: 35px;
}
.minus {
 background: url(https://html-plus.in.ua/wp-content/uploads/2016/04/minus.png) no-repeat 0 6px;
  padding: 10px;
  padding-left: 35px;
}
.hide {display: none;}
.wrapper h2 {
  margin: 0;
  cursor: pointer;
}
              
            
!

JS

              
                var change = document.getElementsByClassName("plus");
var len = change.length;
for(var i=0; i<len; i++){
  change[i].onclick = function(){
     this.classList.toggle("minus");
     this.children[1].classList.toggle("hide");
  }
}


              
            
!
999px

Console