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="snip1162">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample22.jpg" alt="sq-sample22" />
  <figcaption>
    <div class="heading">
      <h2>Gordon <span> Norman</span></h2>
    </div>
    <p>I think we dream so we don't have to be apart so long. If we're in each other's dreams, we can play together all night</p>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1162 hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample21.jpg" alt="sq-sample21" />
  <figcaption>
    <div class="heading">
      <h2>Jason <span> Response</span></h2>
    </div>
    <p>If you want to stay dad you've got to polish your image. I think the image we need to create for you is "repentant but learning". </p>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1162"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample18.jpg" alt="sq-sample18" />
  <figcaption>
    <div class="heading">
      <h2>Pelican <span> Steve</span></h2>
    </div>
    <p>That's the problem with science. You've got a bunch of empiricists trying to describe things of unimaginable wonder.</p>
  </figcaption>
  <a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,500,800);
figure.snip1162 {
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 220px;
  max-width: 310px;
  max-height: 310px;
  width: 100%;
  background: #000000;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
figure.snip1162 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.45s ease-in-out;
  transition: all 0.45s ease-in-out;
}
figure.snip1162 img {
  max-width: 100%;
  position: relative;
  opacity: 0.9;
}
figure.snip1162 figcaption {
  position: absolute;
  top: 45%;
  left: 7%;
  right: 7%;
  bottom: 45%;
  border: 1px solid white;
  border-width: 0 1px 1px;
}
figure.snip1162 .heading {
  overflow: hidden;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
figure.snip1162 h2 {
  display: table;
  margin: 0 auto;
  padding: 0 10px;
  position: relative;
  text-align: center;
  width: auto;
  text-transform: uppercase;
  font-weight: 400;
}
figure.snip1162 h2 span {
  font-weight: 800;
}
figure.snip1162 h2:before,
figure.snip1162 h2:after {
  position: absolute;
  display: block;
  width: 1000%;
  height: 1px;
  content: '';
  background: white;
  top: 50%;
}
figure.snip1162 h2:before {
  left: -1000%;
}
figure.snip1162 h2:after {
  right: -1000%;
}
figure.snip1162 p {
  top: 50%;
  font-size: 0.9em;
  font-weight: 500;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  position: absolute;
  width: 100%;
  padding: 0 20px;
  margin: 0;
  opacity: 0;
}
figure.snip1162 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  z-index: 1;
}
figure.snip1162:hover img,
figure.snip1162.hover img {
  opacity: 0.25;
  -webkit-transform: scale(1.1);
  transform: scale(1.1);
}
figure.snip1162:hover figcaption,
figure.snip1162.hover figcaption {
  top: 7%;
  bottom: 7%;
}
figure.snip1162:hover p,
figure.snip1162.hover p {
  opacity: 1;
  -webkit-transition-delay: 0.35s;
  transition-delay: 0.35s;
}


/* Demo purposes only */
html {
  height: 100%;
}
body {
  background-color: #212121;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: wrap;
  margin: 0;
  height: 100%;
}
              
            
!

JS

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

Console