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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample20.jpg)" class="snip1090 red"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample20.jpg" alt="sample20"/>
  <figcaption> 
    <h2>Misti<span> Maestas</span></h2>
    <p> That's the whole problem with science. You've got a bunch of empiricists trying to describe things of unimaginable wonder.
    </p>
  </figcaption>
  <div class="links"><a href="#"><i class="ion-clipboard"></i><span>Details</span></a><a href="#"><i class="ion-edit"></i><span>Subscribe</span></a></div>
</figure>
<figure style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample47.jpg)" class="snip1090 blue hover"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample47.jpg" alt="sample47"/>
  <figcaption>
    <h2>Pura<span> Serrano</span></h2>
    <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>
  <div class="links"><a href="#"><i class="ion-clipboard"></i><span>Details</span></a><a href="#"><i class="ion-edit"></i><span>Subscribe</span></a></div>
</figure>
<figure style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample41.jpg)" class="snip1090"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample41.jpg" alt="sample41"/>
  <figcaption>
    <h2>Tequila<span> Ammons</span></h2>
    <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>
  <div class="links"><a href="#"><i class="ion-clipboard"></i><span>Details</span></a><a href="#"><i class="ion-edit"></i><span>Subscribe</span></a></div>
</figure>
              
            
!

CSS

              
                @import url(https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css);
@import url(https://fonts.googleapis.com/css?family=Raleway:400,800);
figure.snip1090 {
  background-blend-mode: multiply;
  font-family: 'Raleway', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 220px;
  max-width: 310px;
  max-height: 230px;
  width: 100%;
  background-color: #535353;
  background-size: 100% auto;
  color: #ffffff;
  text-align: left;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
figure.snip1090 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all 0.45s ease-in-out;
  transition: all 0.45s ease-in-out;
}
figure.snip1090 img {
  max-width: 100%;
  position: relative;
  opacity: 0;
}
figure.snip1090 figcaption {
  position: absolute;
  top: 0px;
  left: 0px;
  padding: 30px;
  z-index: 1;
}
figure.snip1090 h2,
figure.snip1090 p {
  margin: 0;
}
figure.snip1090 h2 {
  display: inline-block;
  letter-spacing: -1px;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 5px;
}
figure.snip1090 h2 span {
  font-weight: 800;
}
figure.snip1090 p {
  font-size: 0.85em;
}
figure.snip1090 .links {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  text-align: center;
}
figure.snip1090 .links a {
  width: 50%;
  float: left;
  display: block;
  background: none;
  border: 0;
  background-color: #202020;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 44px;
  text-decoration: none;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}
figure.snip1090 .links a i {
  margin-right: 10px;
  font-size: 18px;
}
figure.snip1090 .links a:last-of-type {
  background-color: #ffffff;
  color: #393939;
}
figure.snip1090 .links a:hover {
  background-color: #131313;
  color: #fff;
}
figure.snip1090.blue {
  background-color: #164666;
}
figure.snip1090.blue a {
  background-color: #2980b9;
}
figure.snip1090.blue a:last-of-type {
  background-color: #ffffff;
  color: #2980b9;
}
figure.snip1090.blue a:hover {
  background-color: #164666;
  color: #fff;
}
figure.snip1090.red {
  background-color: #6d2018;
}
figure.snip1090.red a {
  background-color: #c0392b;
}
figure.snip1090.red a:last-of-type {
  background-color: #ffffff;
  color: #c0392b;
}
figure.snip1090.red a:hover {
  background-color: #6d2018;
  color: #fff;
}
figure.snip1090.yellow {
  background-color: #976008;
}
figure.snip1090.yellow a {
  background-color: #f39c12;
}
figure.snip1090.yellow a:last-of-type {
  background-color: #ffffff;
  color: #f39c12;
}
figure.snip1090.yellow a:hover {
  background-color: #976008;
  color: #fff;
}
figure.snip1090.green {
  background-color: #145b32;
}
figure.snip1090.green a {
  background-color: #27ae60;
}
figure.snip1090.green a:last-of-type {
  background-color: #ffffff;
  color: #27ae60;
}
figure.snip1090.green a:hover {
  background-color: #145b32;
  color: #fff;
}
figure.snip1090:hover img,
figure.snip1090.hover img {
  opacity: 1;
}
figure.snip1090:hover figcaption,
figure.snip1090.hover figcaption {
  opacity: 0;
}
figure.snip1090:hover:after,
figure.snip1090.hover:after {
  opacity: 0.85;
}
figure.snip1090:hover .reveal:after,
figure.snip1090.hover .reveal:after {
  left: 100%;
}


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