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="snip1518">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample101.jpg" alt="sample101" /></div>
  <figcaption>
    <h5>Food</h5>
    <h3>Everything has beauty, but not everyone sees it</h3>
    <footer>
      <div class="date">October 30, 2015</div>
      <div class="icons">
        <div class="views"><i class="ion-eye"></i>2,907</div>
        <div class="love"><i class="ion-heart"></i>623</div>
      </div>
    </footer>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1518 hover">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample99.jpg" alt="sample99" /></div>
  <figcaption>
    <h5>Travel</h5>
    <h3>A friend walks in when everyone else walks out </h3>
    <footer>
      <div class="date">November 7, 2016</div>
      <div class="icons">
        <div class="views"><i class="ion-eye"></i>1,870</div>
        <div class="love"><i class="ion-heart"></i>973</div>
      </div>
    </footer>
  </figcaption>
  <a href="#"></a>
</figure>
<figure class="snip1518">
  <div class="image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample107.jpg" alt="sample107" /></div>
  <figcaption>
    <h5>World</h5>
    <h3>He who dares to teach must never cease to learn</h3>
    <footer>
      <div class="date">January 21, 2016</div>
      <div class="icons">
        <div class="views"><i class="ion-eye"></i>928</div>
        <div class="love"><i class="ion-heart"></i>198</div>
      </div>
    </footer>
  </figcaption>
  <a href="#"></a>
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato);
@import url(https://fonts.googleapis.com/css?family=Oswald);
@import url(https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css);
.snip1518 {
  font-family: 'Lato', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 250px;
  max-width: 310px;
  width: 100%;
  background-color: #ffffff;
  color: #2B2B2B;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}

.snip1518 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.snip1518 img {
  max-width: 100%;
  vertical-align: top;
  position: relative;
}

.snip1518 figcaption {
  padding: 10%;
  padding-bottom: calc(25%);
  background-color: #ffffff;
}

.snip1518 h3 {
  font-family: 'Oswald';
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  margin: 3px 0;
}

.snip1518 h5 {
  font-weight: 400;
  margin: 0;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 1px;
}

.snip1518 footer {
  border-top: 1px solid rgba(0, 0, 0, 0.065);
  padding: 0 20px;
  font-size: 13px;
  line-height: 50px;
  text-align: left;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

.snip1518 footer .icons {
  position: absolute;
  right: 20px;
  top: 0;
}

.snip1518 footer .icons > div {
  display: inline-block;
  margin-left: 8px;
}

.snip1518 footer .icons i {
  display: inline-block;
  margin-right: 5px;
  font-size: 1em;
}

.snip1518 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  z-index: 1;
}
              
            
!

JS

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

Console