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="snip1415"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample22.jpg" alt="sample22" class="background"/>
  <figcaption>
    <blockquote>Which is worse, that everyone has his price, or that the price is always so low.</blockquote>
    <h5>- Emily Barrow</h5>
  </figcaption><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/profile-sample6.jpg" alt="profile-sample6" class="profile"/>
</figure>
<figure class="snip1415 hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample36.jpg" alt="sample36" class="background"/>
  <figcaption>
    <blockquote>I'm killing time while I wait for life to shower me with meaning and happiness.</blockquote>
    <h5>- Tim Forever</h5>
  </figcaption><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/profile-sample7.jpg" alt="profile-sample7" class="profile"/>
</figure>
<figure class="snip1415"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample54.jpg" alt="sample54" class="background"/>
  <figcaption>
    <blockquote>The only skills I have the patience to learn are those that have no real application in life. </blockquote>
    <h5>- Jenny Jenkins</h5>
  </figcaption><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/profile-sample9.jpg" alt="profile-sample9" class="profile"/>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Playfair+Display:400,900);
.snip1415 {
  font-family: 'Playfair Display', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 315px;
  max-height: 220px;
  width: 100%;
  color: #000000;
  text-align: right;
  font-size: 16px;
  background-color: #000000;
}
.snip1415 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.35s ease;
  transition: all 0.35s ease;
}
.snip1415 .background {
  max-width: 100%;
  backface-visibility: hidden;
  opacity: 0.5;
}
.snip1415 figcaption {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
  opacity: 1;
  padding: 30px 0 30px 10px;
  background-color: #ffffff;
  width: 40%;
}
.snip1415 figcaption:before {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  right: 100%;
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 120px 120px 120px 0;
  border-color: transparent #ffffff transparent transparent;
}
.snip1415:after {
  position: absolute;
  top: 50%;
  right: 40%;
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 120px 120px 120px;
  border-color: transparent transparent rgba(255, 255, 255, 0.5) transparent;
}
.snip1415 h5,
.snip1415 blockquote {
  line-height: 1.6em;
  -webkit-transform: translateX(-30px);
  transform: translateX(-30px);
  margin: 0;
}
.snip1415 h5 {
  margin: 10px 0;
  line-height: 1.1em;
  font-weight: 900;
  color: #1a1a1a;
}
.snip1415 blockquote {
  font-size: 0.9em;
  font-style: italic;
}
.snip1415 .profile {
  position: absolute;
  width: 100px;
  border-radius: 50%;
  top: 50%;
  left: 25%;
  z-index: 1;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

              
            
!

JS

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

              
            
!
999px

Console