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.

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

              
                <figure class="snip1307">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample66.jpg" alt="sample66"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample66.jpg" alt="sample66"/>
  <figcaption>
    <h3>Ruby<span> Von Rails</span></h3>
    <p>I suppose the secret to happiness is learning to appreciate the moment.</p>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1307 hover">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample21.jpg" alt="sample21"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample21.jpg" alt="sample21"/>
  <figcaption>
    <h3>Parsley<span> Montana</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="snip1307">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample52.jpg" alt="sample52"/><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample52.jpg" alt="sample52"/>
  <figcaption>
    <h3>Hanson<span> Deck</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.snip1307 {
  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.snip1307 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.4s ease-out;
  transition: all 0.4s ease-out;
}
figure.snip1307 img {
  max-width: 100%;
  vertical-align: top;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
}
figure.snip1307 img:first-of-type {
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  opacity: 0.25;
}
figure.snip1307 img:nth-of-type(2) {
  position: absolute;
  right: 95%;
  top: 0;
  z-index: 1;
}
figure.snip1307 figcaption {
  background-color: rgba(0, 0, 0, 0.5);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px 15px 15px 15%;
}
figure.snip1307 figcaption h3,
figure.snip1307 figcaption p {
  margin: 0 0 5px;
}
figure.snip1307 figcaption h3 {
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 5px;
}
figure.snip1307 figcaption h3 span {
  font-weight: 700;
}
figure.snip1307 figcaption p {
  opacity: 0.8;
}
figure.snip1307 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  z-index: 2;
}
figure.snip1307:hover img,
figure.snip1307.hover img {
  -webkit-transform: translateX(95%);
  transform: translateX(95%);
}

              
            
!

JS

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

              
            
!
999px

Console