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="snip1334"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample38.jpg" alt="sample38"/>
  <figcaption>
    <h2>Indigo Violet</h2>
    <p>Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. </p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip1334 hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample91.jpg" alt="sample91"/>
  <figcaption>
    <h2>Pelican Steve</h2>
    <p>I don't understand this! Not a single part of my horoscope came true! ... The paper should print Mom's daily predictions. Those sure come true.</p>
  </figcaption><a href="#"></a>
</figure>
<figure class="snip1334"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample96.jpg" alt="sample96"/>
  <figcaption>
    <h2>Hanson Deck</h2>
    <p>Given that sooner or later we're all just going to die, what's the point of learning about integers?</p>
  </figcaption><a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway);
@import url(https://fonts.googleapis.com/css?family=Julius+Sans+One);
.snip1334 {
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 315px;
  width: 100%;
  color: #ffffff;
  text-align: left;
  background-color: #ffffff;
  line-height: 1.4em;
  transform: translateZ(0);
}
.snip1334 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.35s ease-out;
  transition: all 0.35s ease-out;
}
.snip1334 img {
  max-width: 100%;
  vertical-align: top;
  -webkit-transition: all 0.8s ease-out;
  transition: all 0.8s ease-out;
}
.snip1334:before {
  background: #000000;
  position: absolute;
  content: '';
  -webkit-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
  z-index: 1;
  left: 50%;
  right: 50%;
  top: 0;
  bottom: 0;
  box-shadow: 0 0 20px white;
}
.snip1334 figcaption {
  position: absolute;
  top: 0;
  height: 100%;
  left: 0;
  width: 100%;
  z-index: 2;
}
.snip1334 h2,
.snip1334 p {
  margin: 0;
  width: 100%;
  opacity: 0;
  padding: 25px;
}
.snip1334 h2 {
  font-family: 'Julius Sans One', Arial, sans-serif;
}
.snip1334 p {
  position: absolute;
  bottom: 0;
  padding-left: 60px;
  font-size: 0.8em;
  letter-spacing: 1px;
  text-align: right;
}
.snip1334 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  z-index: 2;
}
.snip1334:hover img,
.snip1334.hover img {
  opacity: 0.2;
}
.snip1334:hover:before,
.snip1334.hover:before {
  left: 0;
  right: 0;
  box-shadow: 0 0 0px white;
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
}
.snip1334:hover figcaption h2,
.snip1334.hover figcaption h2,
.snip1334:hover figcaption p,
.snip1334.hover figcaption p {
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}
.snip1334:hover figcaption h2,
.snip1334.hover figcaption h2 {
  -webkit-transform: translateY(0%);
  transform: translateY(0%);
  opacity: 0.5;
}
.snip1334:hover figcaption p,
.snip1334.hover figcaption p {
  opacity: 0.7;
}
              
            
!

JS

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

              
            
!
999px

Console