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="snip0069 yellow">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample1.jpg" alt="sample47"/></div>
  <figcaption>
    <h3>Adventure</h3>
    <p>My family is dysfunctional and my parents won't empower me. Consequently I'm not self actualized.</p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip0069 red hover">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample2.jpg" alt="sample39"/></div>
  <figcaption>
    <h3>Night Life</h3>
    <p>That's the difference between me and the rest of the world! Happiness isn't good enough for me! I demand euphoria!</p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip0069 blue">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample3.jpg" alt="sample6"/></div>
  <figcaption>
    <h3>Day Trips</h3>
    <p>You know what we need, Hobbes? We need an attitude. Yeah, you can't be cool if you don't have an attitude.</p>
  </figcaption><a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,500);
figure.snip0069 {
  font-family: 'Raleway', Arial, sans-serif;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 220px;
  max-width: 310px;
  width: 100%;
  text-align: center;
}
figure.snip0069 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
figure.snip0069 > .image {
  display: block;
  position: relative;
  padding: 15px 0;
}
figure.snip0069 > .image img {
  width: 70%;
  border-radius: 50%;
}
figure.snip0069 > .image:before {
  position: absolute;
  bottom: 0;
  content: '';
  background: #ffffff;
  width: 100%;
  top: 50%;
  left: 0;
  right: 0;
  z-index: -1;
}
figure.snip0069 figcaption {
  position: relative;
  background: #ffffff;
}
figure.snip0069 figcaption:before {
  position: absolute;
  width: 100%;
  background: #000000;
  height: 0px;
  bottom: 0;
  display: block;
  content: '';
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}
figure.snip0069 h3,
figure.snip0069 p {
  margin: 0;
  display: inline-block;
  width: 100%;
}
figure.snip0069 h3 {
  padding: 10px 15px;
  background: #333333;
  text-transform: uppercase;
}
figure.snip0069 p {
  font-size: 0.9em;
  font-weight: 500;
  background: #ffffff;
  color: #4d4d4d;
  padding: 20px 40px 30px;
}
figure.snip0069 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  color: #ffffff;
}
figure.snip0069.blue h3,
figure.snip0069.blue figcaption:before {
  background: #2980b9;
}
figure.snip0069.red h3,
figure.snip0069.red figcaption:before {
  background: #c0392b;
}
figure.snip0069.yellow h3,
figure.snip0069.yellow figcaption:before {
  background: #e67e22;
}
figure.snip0069.navy h3,
figure.snip0069.navy figcaption:before {
  background: #34495e;
}
figure.snip0069:hover figcaption:before,
figure.snip0069.hover figcaption:before {
  height: 10px;
}


/* 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 */
  $("figure").mouseleave(
    function() {
      $(this).removeClass("hover");
    }
  );
              
            
!
999px

Console