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

              
                
<figure class="snip1345"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/pr-sample21.jpg" alt="pr-sample21"/>
  <div class="inside">
    <figcaption>
      <h3>Hanson Deck</h3>
      <p>Weekends don't count unless you spend them doing something completely pointless.</p>
    </figcaption>
  </div><a href="#"></a>
</figure>
<figure class="snip1345 hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/pr-sample24.jpg" alt="pr-sample24"/>
  <div class="inside">
    <figcaption>
      <h3>Sue Shei</h3>
      <p>I'm killing time while I wait for life to shower me with meaning and happiness.</p>
    </figcaption>
  </div><a href="#"></a>
</figure>
<figure class="snip1345"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/pr-sample15.jpg" alt="pr-sample15"/>
  <div class="inside">
    <figcaption>
      <h3>Desmond Eagle</h3>
      <p>The only skills I have the patience to learn are those that have no real application in life. </p>
    </figcaption>
  </div><a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Yeseva+One);
@import url(https://fonts.googleapis.com/css?family=Merriweather+Sans);
.snip1345 {
  font-family: 'Merriweather Sans', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 315px;
  width: 100%;
  color: #ffffff;
  text-align: center;
  line-height: 1.4em;
  font-size: 16px;
  transform: translateZ(0);
}
.snip1345:before {
  position: absolute;
  content: '';
  bottom: 0;
  left: 0;
  width: 100%;
  height: 85%;
  background-image: -webkit-linear-gradient(top, transparent 0%, #000000 85%);
  background-image: linear-gradient(to bottom, transparent 0%, #000000 85%);
}
.snip1345 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.35s ease;
  transition: all 0.35s ease;
}
.snip1345 img {
  max-width: 100%;
  vertical-align: top;
}
.snip1345 .inside {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  right: 20px;
  border: 20px solid #000000;
  box-shadow: 0px 0px 3px 19px rgba(0, 0, 0, 0.5);
}
.snip1345 figcaption {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
}
.snip1345 h3,
.snip1345 p {
  margin: 0 0 10px;
}
.snip1345 h3 {
  font-size: 1.3em;
  font-family: 'Yeseva One', Arial, sans-serif;
}
.snip1345 p {
  font-size: 0.8em;
  letter-spacing: 1px;
  opacity: 0.75;
}
.snip1345 a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}
.snip1345:hover .inside,
.snip1345.hover .inside {
  box-shadow: 0px 0px 3px 19px rgba(0, 0, 0, 0);
}

              
            
!

JS

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

              
            
!
999px

Console