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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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="snip1244">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample35.jpg" alt="sq-sample35"/>
  <figcaption>
    <h3>Fletch Skinner</h3>
    <p>I don't need to compromise my principles, because they don't have the slightest bearing on what happens to me anyway. </p>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1244 hover">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sq-sample14.jpg" alt="sq-sample14"/>
  <figcaption>
    <h3>Indigo Violet</h3>
    <p>What's the point of wearing your favorite rocketship underpants if nobody ever asks to see 'em?</p>
  </figcaption>
  <a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,500,700);
.snip1244 {
  font-family: 'Raleway', Arial, sans-serif;
  color: #fff;
  position: relative;
  margin: 10px;
  min-width: 480px -60px;
  max-width: 480px;
  width: 100%;
  color: #ffffff;
  text-align: left;
  background-color: #0d0d0d;
  font-size: 16px;
}
.snip1244 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.4s ease-in;
  transition: all 0.4s ease-in;
}
.snip1244 img {
  position: relative;
  max-width: 50%;
  vertical-align: top;
}
.snip1244 figcaption {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  padding: 20px 0 20px 50%;
}
.snip1244 figcaption:before,
.snip1244 figcaption:after {
  width: 1px;
  height: 0;
}
.snip1244 figcaption:before {
  right: 0;
  top: 0;
}
.snip1244 figcaption:after {
  left: 0;
  bottom: 0;
}
.snip1244 h3,
.snip1244 p {
  line-height: 1.5em;
  padding: 0 30px;
}
.snip1244 h3 {
  margin: 0 0 5px;
  font-weight: 700;
  text-transform: uppercase;
}
.snip1244 p {
  font-size: 0.8em;
  font-weight: 500;
  margin: 0 0 15px;
}
.snip1244 a {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 1;
}
.snip1244:before,
.snip1244:after,
.snip1244 figcaption:before,
.snip1244 figcaption:after {
  position: absolute;
  content: '';
  background-color: #ffffff;
  z-index: 1;
  -webkit-transition: all 0.4s ease-in;
  transition: all 0.4s ease-in;
  opacity: 0.8;
}
.snip1244:before,
.snip1244:after {
  height: 1px;
  width: 0%;
}
.snip1244:before {
  top: 0;
  left: 0;
}
.snip1244:after {
  bottom: 0;
  right: 0;
}
.snip1244:hover figcaption,
.snip1244.hover figcaption {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.05);
}
.snip1244:hover figcaption:before,
.snip1244.hover figcaption:before,
.snip1244:hover figcaption:after,
.snip1244.hover figcaption:after {
  height: 100%;
}
.snip1244:hover:before,
.snip1244.hover:before,
.snip1244:hover:after,
.snip1244.hover:after {
  width: 100%;
}
.snip1244:hover:before,
.snip1244.hover:before,
.snip1244:hover:after,
.snip1244.hover:after,
.snip1244:hover figcaption:before,
.snip1244.hover figcaption:before,
.snip1244:hover figcaption:after,
.snip1244.hover figcaption:after {
  opacity: 0.1;
}
@media only screen and (max-width: 480px) {
  .snip1244 img {
    max-width: 100%;
  }
  .snip1244 figcaption {
    position: relative;
    padding-left: 0px;
  }
}

              
            
!

JS

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

Console