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

              
                <ul>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/rachel.jpg" />
      </div>
      <div class="text"><span class="name">Rachel Green</span>Barton did feebly change man she afford square add. Want eyes by neat so just must.</div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/joey.jpg" />
      </div>
      <div class="text"><span class="name">Joey Tribbiani</span>Abilities forfeited situation extremely my to he resembled. Old had conviction discretion understood put principles you. </div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/manica.jpg" />
      </div>
      <div class="text"><span class="name">Monica Geller</span>Shot what able cold new the see hold. Friendly as an betrayed formerly he. Morning because as to society behaved moments. Put ladies design mrs sister was.  </div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/phoebe.jpg" />
      </div>
      <div class="text"><span class="name">Phoebe Buffay</span>Enjoyed minutes related as at on on. Is fanny dried as often me. </div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/chandler.jpg" />
      </div>
      <div class="text"><span class="name">Chandler Bing</span>Arrived compass prepare an on as. Reasonable particular on my it in sympathize. Size now easy eat hand how. </div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
  <li>
    <div class="detail">
      <div class="pic">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/ross.jpg" />
      </div>
      <div class="text"><span class="name">Ross Geller</span>Travelling alteration impression six all uncommonly. Chamber hearing inhabit joy highest private ask him our believe. </div>
    </div>
    <div class="toolbar">
      <div class="fold-top"></div>
      <div class="fold-bottom"></div>
      <div class="icons">
        <span class="entypo-heart"></span>
        <span class="entypo-reply"></span>
        <span class="entypo-share"></span>
        <span class="entypo-star"></span>
        <span class="entypo-retweet"></span>
      </div>
    </div>  
  </li>
</ul>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400);

@import url(http://weloveiconfonts.com/api/?family=entypo);

body {
  background: #eee;
  font-family: 'Open Sans';
  font-weight: 300;
}

[class*="entypo-"]:before {
  font-family: 'entypo', sans-serif;
}

ul {
  width: 320px;
  list-style: none;
  padding: 0;
  margin: 0 auto;
}

li {
  display: block;
}


.detail {
  width: 100%;
  background: #fff;
  transition: all 0.2s ease-in-out;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.open .detail {
  background: #333;
  color: #ccc;
  border-bottom: 0;
}

.detail .pic {
  float: left;
  left: 10px;
  width: 65px;
  height: 65px;
  overflow: hidden;
  position: relative;
  border-radius: 50%;
}

.detail .text {
  left: 20px;
  position: relative;
  display: block;
  overflow: hidden;
  width: 225px;
}

.detail .text span {
  display: block;
  font-weight: 400;
}

.open .detail .text span {
  color: #fff;
}

.toolbar {
  width: 100%;
  background: #222;
  height: 0;
  position: relative;
  transition: height 0.2s ease-in-out;
  perspective: 200px;
  overflow: hidden;
}

.open .toolbar {
  width: 100%;
  height: 40px;  
}

.fold-top, .fold-bottom {
  height: 20px;
  width: 312px;
  left: 4px;
  position: absolute;
  transition: all 0.22s ease-in-out;
}

.open .fold-top, .open .fold-bottom {
  background: #5c5c5c;
  transform: rotateX(0deg);
  width: 100%;
  left: 0;
}

.fold-top {
  transform-origin: top center;
  transform: rotateX(-90deg);
  top: 0;
  background: #444;
}

.fold-bottom {
  transform-origin: bottom center;
  transform: rotateX(90deg);
  bottom: 0;
  background: #666;
}

.icons {
  position: absolute;
  color: #fff;
  height: 40px;
  line-height: 40px;
  font-size: 20px;
  transition: all 0.2s ease-in-out;
  opacity: 0;
  transform: rotateX(60deg);
}

.icons span {
  margin-left: 35px;
  cursor: pointer;
}

.open .icons {
  opacity: 1;
  transform: rotateX(0deg);
}
              
            
!

JS

              
                var clickEvent = ('ontouchstart' in window) ? 'touchstart' : 'click';

$('.detail').on(clickEvent, function() {
    $(this).parent('li').toggleClass('open').siblings().removeClass('open');
});

              
            
!
999px

Console