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="snip1388">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample28.jpg" alt="sq-sample28" /></div>
  <figcaption>
    <div>
      <h2>Will</h2>
      <h3>Barrow</h3>
    </div>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1388 hover">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample19.jpg" alt="sq-sample19" /></div>
  <figcaption>
    <div>
      <h2>Inverness</h2>
      <h3>McKenzie</h3>
    </div>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1388">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample21.jpg" alt="sq-sample21" /></div>
  <figcaption>
    <div>
      <h2>Norman</h2>
      <h3>Gorman</h3>
    </div>
  </figcaption>
  <a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Sacramento);
@import url(https://fonts.googleapis.com/css?family=Raleway:300;);
.snip1388 {
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 315px;
  width: 100%;
  color: #ffffff;
  text-align: center;
  font-size: 16px;
  background-color: #ad4334;
}
.snip1388 *,
.snip1388 *:before,
.snip1388 *:after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.55s ease;
  transition: all 0.55s ease;
}
.snip1388:after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  content: '';
}
.snip1388 .image {
  border: 20px solid #863428;
  overflow: hidden;
}
.snip1388 .image:after {
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 40px;
  right: 40px;
  background-color: #9a3c2e;
  content: '';
}
.snip1388 img {
  max-width: 100%;
  backface-visibility: hidden;
  vertical-align: top;
  -webkit-filter: grayscale(40%);
  filter: grayscale(40%);
  opacity: 0.9;
}
.snip1388 figcaption {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  padding: 5px 10px 10px;
}
.snip1388 h2,
.snip1388 h3 {
  margin: 0;
  line-height: 0.75em;
}
.snip1388 h2 {
  font-family: 'Sacramento', Arial, sans-serif;
  font-size: 2.5em;
  font-weight: 400;
}
.snip1388 h3 {
  text-transform: uppercase;
  opacity: 0.6;
  font-weight: 300;
  font-size: 1.6em;
}
.snip1388 a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}
.snip1388:hover img,
.snip1388.hover img {
  -webkit-transform: scale(1.2);
  transform: scale(1.2);
}

              
            
!

JS

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

              
            
!
999px

Console