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="snip0070 green">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample52.jpg" alt="sample47" />
  <figcaption>
    <h3>Keith Burns</h3>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip0070 blue hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample3.jpg" alt="sample21" />
  <figcaption>
    <h3>Ian Willis</h3>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip0070 red"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample36.jpg" alt="sample17" />
  <figcaption>
    <h3>Lynn Simpson</h3>
  </figcaption>
  <a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,800);
figure.snip0070 {
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  margin: 10px;
  min-width: 220px;
  max-width: 310px;
  max-height: 220px;
  width: 100%;
  overflow: hidden;
  text-align: left;
  background: #000000;
  -webkit-perspective: 50em;
  perspective: 50em;
}
figure.snip0070 * {
  -webkit-transition: all 0.35s ease-in-out;
  transition: all 0.35s ease-in-out;
}
figure.snip0070 img {
  opacity: 0.3;
  max-width: 100%;
  position: relative;
  top: 0;
  left: 0;
}
figure.snip0070 figcaption {
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 30px;
  right: 30px;
  background: #000000;
}
figure.snip0070 figcaption h3 {
  font-size: 1.4em;
  top: 50%;
  letter-spacing: -1px;
  position: absolute;
  color: #ffffff;
  text-transform: uppercase;
  padding: 0 20px;
  margin: 0;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
figure.snip0070.blue {
  background: #091b27;
}
figure.snip0070.blue figcaption {
  background: #2980b9;
}
figure.snip0070.red {
  background: #2e0e0a;
}
figure.snip0070.red figcaption {
  background: #c0392b;
}
figure.snip0070.yellow {
  background: #4d2909;
}
figure.snip0070.yellow figcaption {
  background: #e67e22;
}
figure.snip0070.green {
  background: #061c10;
}
figure.snip0070.green figcaption {
  background: #27ae60;
}
figure.snip0070 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
}
figure.snip0070:hover img,
figure.snip0070.hover img {
  opacity: 1;
}
figure.snip0070:hover figcaption,
figure.snip0070.hover figcaption {
  opacity: 0;
  -webkit-transform: rotateY(90deg);
  transform: rotateY(90deg);
}


/* 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