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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <aside class="mainToggle">
  <ul class="wrapToggle">
    <li>
      <h4 class="head blue">List Item</h4>
      <p class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vehicula eros eu lacus congue, non gravida tellus aliquam. Maecenas sed libero metus. Phasellus metus purus, adipiscing vitae pellentesque eu, semper quis libero. Sed euismod varius augue, ut rhoncus turpis consequat quis. Aliquam sit amet enim sit amet ligula euismod ullamcorper in a tellus. Curabitur porta leo vel orci lacinia condimentum. Vivamus commodo ut mauris et vestibulum.</p>
    </li>
    <li>
      <h4 class="head strawb">List Item</h4>
      <p class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vehicula eros eu lacus congue, non gravida tellus aliquam. Maecenas sed libero metus. Phasellus metus purus, adipiscing vitae pellentesque eu, semper quis libero. Sed euismod varius augue, ut rhoncus turpis consequat quis. Aliquam sit amet enim sit amet ligula euismod ullamcorper in a tellus. Curabitur porta leo vel orci lacinia condimentum. Vivamus commodo ut mauris et vestibulum.</p>
    </li>
    <li>
      <h4 class="head yellow">List Item</h4>
      <p class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vehicula eros eu lacus congue, non gravida tellus aliquam. Maecenas sed libero metus. Phasellus metus purus, adipiscing vitae pellentesque eu, semper quis libero. Sed euismod varius augue, ut rhoncus turpis consequat quis. Aliquam sit amet enim sit amet ligula euismod ullamcorper in a tellus. Curabitur porta leo vel orci lacinia condimentum. Vivamus commodo ut mauris et vestibulum.</p>
    </li>
    <li>
      <h4 class="head green">List Item</h4>
      <p class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vehicula eros eu lacus congue, non gravida tellus aliquam. Maecenas sed libero metus. Phasellus metus purus, adipiscing vitae pellentesque eu, semper quis libero. Sed euismod varius augue, ut rhoncus turpis consequat quis. Aliquam sit amet enim sit amet ligula euismod ullamcorper in a tellus. Curabitur porta leo vel orci lacinia condimentum. Vivamus commodo ut mauris et vestibulum.</p>
    </li>
    <li>
      <h4 class="head pink">Credits</h4>
      <p class="content">Created by <a href="https://twitter.com/joericho">@joericho</a></p>
    </li>
  </ul>
</aside>
              
            
!

CSS

              
                /*
*
* Copyright 2013, Joe Richardson
* Free to use under the MIT license.
* https://www.opensource.org/licenses/mit-license.php
*
*/

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
     -moz-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
          text-size-adjust: 100%;
}

input:focus,
textarea:focus {
  outline: none;
}

label,
select,
button,
input[type="submit"],
input[type="radio"],
input[type="checkbox"] input[type="button"] {
  cursor: pointer;
}

a,
a:visited,
a:active,
a:hover {
  color: #ed327b;
  text-decoration: none;
}

*,
*:after,
*:before {
  margin: 0;
  padding: 0;
  -webkit-backface-visibility: hidden;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  font-family: "Montserrat", Helvetica Neue, Arial;
  font-size: 17px;
}

.wrapToggle > li {
  cursor:pointer;
}

.wrapToggle > li > h4 {
  padding:20px;
  text-transform:uppercase;
  letter-spacing:2px;
  color:#fff;
  font-size:13px;
  text-shadow:1px 1px 0px rgba(0,0,0,.1);
}

.blue { 
  background: #3a9bdc;
  border:4px solid rgba(0,0,0,.1);
}

.strawb {
  background: #ff6060;
  border:4px solid rgba(0,0,0,.1);
}

.yellow {
  background: #ffc500;
  border:4px solid rgba(0,0,0,.1);
}

.green {
  background: #63b47a;
  border:4px solid rgba(0,0,0,.1);
}

.pink {
  background: #ed327b;
  border:4px solid rgba(0,0,0,.1);
  
}

h4:hover {
  border:4px solid rgba(0,0,0,.2);
}

p {
  display:none;
  padding:15px;
  font-size:15px;
  word-spacing:3px;
  line-height:1.5em;
  background:#fff;
  color:#bbb;
  border-left:5px solid rgba(0,0,0,.1);
  border-right:5px solid rgba(0,0,0,.1);
}

p:last-of-type {
  border:4px solid rgba(0,0,0,.1);
}
              
            
!

JS

              
                $(function () {
    $('.head').click(function () {
        $(this).next('.content').slideToggle();
        $(this).parent().siblings().children().next().slideUp();
        return false;
    });
    $('.head').bind('touchstart', function (e) {
        $(this).trigger('click');
        e.preventDefault();
    });
});
              
            
!
999px

Console