Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <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>
            
          
!
            
              @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%);
}

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

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console