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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              
<figure class="snip1354 green"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample97.jpg" alt="sample97"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample97.jpg" alt="sample97"/>
  <figcaption>
    <h3>Fleece<span> Marigold</span></h3>
    <p>I suppose the secret to happiness is learning to appreciate the moment.</p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip1354 blue hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample98.jpg" alt="sample98"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample98.jpg" alt="sample98"/>
  <figcaption>
    <h3>Linguina<span> Nettlewater</span></h3>
    <p>I think nighttime is dark so you can imagine your fears with less distraction.</p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip1354 orange"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample99.jpg" alt="sample99"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample99.jpg" alt="sample99"/>
  <figcaption>
    <h3>Chauffina<span> Carr</span></h3>
    <p>If we wanted more leisure, we'd invent machines that do things less efficiently.</p>
  </figcaption><a href="#"></a>
</figure>
            
          
!

CSS

            
              @import url(https://fonts.googleapis.com/css?family=Josefin+Sans:400,700);
figure.snip1354 {
  font-family: 'Josefin Sans', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 315px;
  width: 100%;
  background: #000000;
  text-align: left;
  color: #ffffff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  font-size: 16px;
}
figure.snip1354 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.4s ease-out;
  transition: all 0.4s ease-out;
}
figure.snip1354 img {
  max-width: 100%;
  vertical-align: top;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
}
figure.snip1354 img:first-of-type {
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  opacity: 0.25;
}
figure.snip1354 img:nth-of-type(2) {
  position: absolute;
  top: 95%;
  left: 0;
  z-index: 1;
}
figure.snip1354 figcaption {
  background-color: rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 20px;
}
figure.snip1354 figcaption h3,
figure.snip1354 figcaption p {
  margin: 0 0 5px;
}
figure.snip1354 figcaption h3 {
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 5px;
}
figure.snip1354 figcaption h3 span {
  font-weight: 700;
}
figure.snip1354 figcaption p {
  opacity: 0.8;
}
figure.snip1354 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  z-index: 2;
}
figure.snip1354:hover img,
figure.snip1354.hover img {
  -webkit-transform: translateY(-95%);
  transform: translateY(-95%);
}

            
          
!

JS

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

            
          
!
999px

Console