cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <h1>CSS Sliding Caption Reveal</h1>
<h2>Hover over Bill for different directions</h2>
<div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_top">
    <h1>Top to Bottom</h1>
    <a href="#">Read More</a>
  </div>
</div>
  
<div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_topRight">
    <h1>Top Right to Bottom Left</h1>
    <a href="#">Read More</a>
  </div>
</div>
    
 <div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_right">
    <h1>Left to Right</h1>
    <a href="#">Read More</a>
  </div>
</div>
      
 <div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_bottomRight">
    <h1>Bottom Right to Top Left</h1>
    <a href="#">Read More</a>
  </div>
</div>
         
 <div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_bottom">
    <h1>Bottom to Top</h1>
    <a href="#">Read More</a>
  </div>
</div>

 <div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_bottomLeft">
    <h1>Bottom Left to Top Right</h1>
    <a href="#">Read More</a>
  </div>
</div>
   
<div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_left">
    <h1>Left to Right</h1>
    <a href="#">Read More</a>
  </div>
</div>
  
  <div class="screenshot">
  <img src="http://fillmurray.com/300/200">
  <div class="screenshot-caption screenshot-caption_topLeft">
    <h1>Top Left to Bottom Right</h1>
    <a href="#">Read More</a>
  </div>
</div>
            
          
!
            
              @import "compass/css3";


h1, h2 {
  text-align:center;
  color:#2c3e50;
}

.screenshot {
  float: left;
  margin: 50px;
  position: relative;
  overflow: hidden;
}

.screenshot > * { display: block; }

.screenshot-caption {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(44,62,80,.4);
  color: #ffffff;
  -webkit-transition: all 0.5s ease-out;
  -moz-transition: all 0.5s ease-out;
  transition: all 0.5s ease-out;
  
  h1 {
    color: white;
  }

  a {
    display: table;
    margin: 0 auto; 
    text-align: center;
    background: #2c3e50;
    padding: 6px 12px;
    color: white;
    text-decoration: none;
  }
}

.screenshot-caption > * {
  -webkit-transition: opacity 1s ease;
  -moz-transition: opacity 1s ease;
  transition: opacity 1s ease;
  opacity: 0;
}

.screenshot-caption_top {
  top: -100%;
  left: 0;
}
.screenshot-caption_topRight {
  top: -100%;
  left: 100%;
}
.screenshot-caption_right {
  top: 0;
  left: 100%;
}
.screenshot-caption_bottomRight {
  top: 100%;
  left: 100%;
}
.screenshot-caption_bottom {
  top: 100%;
  left: 0;
}
.screenshot-caption_bottomLeft {
  top: 100%;
  left: -100%;
}
.screenshot-caption_left {
  top: 0;
  left: -100%;
}
.screenshot-caption_topLeft {
  top: -100%;
  left: -100%;
}

.screenshot:hover .screenshot-caption {
  top: 0;
  left: 0;
  -webkit-transition: all 0.25s ease-out;
  -moz-transition: all 0.25s ease-out;
  transition: all 0.25s ease-out;
}

.screenshot:hover .screenshot-caption > * {
  -webkit-transition: opacity 1s ease;
  -moz-transition: opacity 1s ease;
  transition: opacity 1s ease;
  opacity: 1;
 
}


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console