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

              
                <h2>Creative Caption Gallery</h2>
<div class="image-container image-container-num1">
  <div class="image image-num1">
    <img src="http://lorempixel.com/g/300/300/technics/" />
  </div>
  <div class="caption caption-num1">
    <span class="bottom">There's<br>always a siren</span>
  </div>
</div><br class="break">
<div class="image-container image-container-num2">
  <div class="image image-num2">
    <img src="http://lorempixel.com/g/200/300/city/" />
  </div>
  <div class="caption caption-num2">
    Singing you to shipwreck
  </div>
</div><br class="break">
<div class="image-container image-container-num3">
  <div class="image image-num3">
    <img src="http://lorempixel.com/g/300/200/nightlife/" />
  </div><br class="break">
  <div class="caption caption-num3">
    Steer away from these rocks
  </div>
</div><br class="break">
<div class="image-container image-container-num4">
  <div class="image image-num4">
    <img src="http://lorempixel.com/g/300/300/transport/" />
  </div>
  <div class="caption caption-num4">
    We'd be a walking disaster
  </div><br class="break">
</div><br class="break">
<div class="image-container image-container-num5">
  <div class="image image-num5">
    <img src="http://lorempixel.com/g/300/300/abstract/" />
  </div>
  <div class="caption caption-num5">
    Just 'cause you feel it
  </div>
</div><br class="break">
<div class="image-container image-container-num6">
  <div class="image image-num6">
    <img src="http://lorempixel.com/g/200/200/people/" />
  </div>
  <div class="caption caption-num6">
    Doesn't mean it's there.
  </div>
</div>
<!--EXPERIMENTAL-->
<!--<br class="break">
<div class="image-container image-container-num7">
  <div class="image image-num7">
    <img src="http://lorempixel.com/g/300/300/animals/" />
  </div>
  <div class="caption caption-num7">
    Someone on your shoulder<br>
    Someone on your shoulder<br>
    There there!
  </div>
</div>-->
              
            
!

CSS

              
                html, body {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Lato", Segoe UI, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 100;
  color: #fff;
  text-align: center;
}
h2 {
  color: #333;
  font-size: 45px;
  margin: 32px;
}
.image-container {
  display: inline-block;
  position: relative;
  width: 200px;
  height: 200px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.image {
  width: 200px;
  height: 200px;
  z-index: 1;
  transition: all .5s;
}
.image img {
  max-width: 100%;
}
.caption {
  width: 200px;
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(0,0,0,.8);
  z-index: 2;
  font-weight: 300;
  transition: all .5s;
}
.caption-num1 {
  position: relative;
  height: 60px;
  padding: none;
  transform: rotate(45deg) translateY(-280px) translateX(-50%);
}
.bottom {
  position: absolute;
  bottom: 15px;
  left: 0px;
  right: 0;
}
.image-container-num1:hover .caption-num1 {
  transform: rotate(45deg) translateY(-200px) translateX(-50%)
}
.caption-num2 {
  transform: translateY(140px);
}
.image-container-num2:hover .image-num2 {
  opacity: .8;
  transform: translateY(-50%) translateY(0px);
}
.image-container-num2:hover .caption-num2 {
  transform: translateY(-37px);
}
.image-num3 img {
  max-width: none;
  max-height: 100%;
}
.image-num3 {
  direction: rtl;
}
.caption-num3 {
  opacity: 0;
  width: 300px;
  text-align:right;
  padding-right: 14px;
  transform: translateY(-100%);
}
.image-container-num3:hover .image-num3 {
  transform: translateX(50%);
}
.image-container-num3:hover .caption-num3 {
  opacity: 1;
  transform: translateY(-100%) translateX(-114px);
}
.image-container-num4:hover .image-num4 {
  transform: scale(1.5) rotate(-10deg);
}
.image-container-num4:hover .caption-num4 {
  transform: translateY(-100%);
}
.image-num5 img {
  max-width: none;
  transform: translateY(-50px) translateX(-50px);
}
.caption-num5 {
  transform: translateY(-100%);
  opacity: 0;
}
.image-container-num5:hover .image-num5 {
  transform: rotate(45deg);
}
.image-container-num5:hover .caption-num5 {
  opacity: 1;
}
.caption-num6 {
  transform: translateY(-200px) translateY(-100%);
}
.image-container-num6:hover .caption-num6 {
  transform: translateY(-200px);
}
.image-container-num6:hover .image-num6 {
  opacity: .5;
}
.caption-num7 {
  height: 200px;
  background: none;
  color: #333;
  font-size: 20px;
  opacity: 0;
}
.image-container-num7:hover .caption-num7 {
  opacity: 1;
  transform: translateY(-75%);
}
.image-container-num7:hover .image-num7 {
  transform: scale(1.5);
  opacity: .15;
}
.break {
  display: none;
}
@media all and (max-width: 650px) {
  .image-container {
    margin: 30px;
    outline: solid 20px #eee;
  }
  .break {
    display: initial;
  }
}
              
            
!

JS

              
                //Feel free to use however you would like!
//Lyrics (captions) by Radiohead ^^

//Song: There, There
  //https://www.youtube.com/watch?v=7AQSLozK7aA
//Album: Hail to the Thief
              
            
!
999px

Console