cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <figure class="snip1571">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample21.jpg" alt="sample21" />
  <figcaption>
    <h3>Wisteria Ravenclaw</h3>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1571 hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample103.jpg" alt="sample103" />
  <figcaption>
    <h3>Benjamin Evalent</h3>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1571"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample104.jpg" alt="sample104" />
  <figcaption>
    <h3>Inverness McKenzie</h3>
  </figcaption>
  <a href="#"></a>
</figure>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600;);
.snip1571 {
  background-color: #000;
  display: inline-block;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  margin: 10px 7px;
  max-width: 315px;
  min-width: 230px;
  overflow: hidden;
  position: relative;
  text-align: center;
  width: 100%;
}
.snip1571 *,
.snip1571 *:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.35s ease;
  transition: all 0.35s ease;
}
.snip1571 img {
  backface-visibility: hidden;
  max-width: 100%;
  vertical-align: top;
}
.snip1571 figcaption {
  bottom: 30px;
  left: 0;
  position: absolute;
  z-index: 0;
}
.snip1571 figcaption:before {
  background-color: #ffffff;
  bottom: -5px;
  content: '';
  left: 0;
  position: absolute;
  right: 100%;
  top: -5px;
  z-index: -1;
}
.snip1571 h3 {
  background-color: #c73232;
  color: #ffffff;
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 0;
  padding: 5px 10px;
  text-transform: uppercase;
  z-index: 1;
}
.snip1571 a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}
.snip1571:hover > img,
.snip1571.hover > img {
  opacity: 0.1;
}
.snip1571:hover figcaption:before,
.snip1571.hover figcaption:before {
  right: -5px;
}
/* Demo purposes only */
body {
  background-color: #212121;
  text-align: center;
}

            
          
!
            
              /* Demo purposes only */
$(".hover").mouseleave(
  function () {
    $(this).removeClass("hover");
  }
);

            
          
!
999px
Loading ..................

Console