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

              
                <!-- Top Caption -->
<div class="img-box top-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Top Caption</span>  
</div>

<!-- Bottom Caption -->  
<div class="img-box bottom-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Bottom Caption</span>  
</div>

<!-- Full Caption up to down -->  
<div class="img-box fullup-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Full Caption up to down</span>  
</div>

<!-- Full Caption down to up -->  
<div class="img-box fulldown-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption ">Full Caption down to up</span>  
</div>

<!-- Fade Caption -->
<div class="img-box fade-me">
  <img src="http://placehold.it/200x182/0cc/fff/"/>  
  <span class="caption fade">Fade Caption</span>  
</div>

<!-- Slide Caption from left to right -->  
<div class="img-box slide-rl-me"> 
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Slide Caption from left to right</span>  
</div>

<!-- Slide Caption from right to left -->  
<div class="img-box slide-lr-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Slide Caption from right to left</span>  
</div>

<!-- Slide Caption from top to bottom -->  
<div class="img-box slide-tb-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Slide Caption from top to bottom</span>  
</div>

<!-- Slide Caption from bottom to top -->  
<div class="img-box slide-bt-me">  
  <img src="http://placehold.it/200x182"/>  
  <span class="caption">Slide Caption from top to bottom</span>  
</div>

<!-- Rotate Caption -->  
<div class="img-box rotate-me">  
  <div class="rotate">
    <img id="image-5" src="http://placehold.it/200x182"/>  
    <span class="caption">Rotate Caption</span>
  </div>  
</div>

<!-- Free Style Caption -->  
<div class="img-box scale">  
  <img src="http://placehold.it/200x182/0cc/fff/"/>  
  <span class="caption scale-caption">Free Style Caption</span>  
</div>

              
            
!

CSS

              
                /* Image Box Style */
.img-box {
  height: 182px;
  width: 200px;
  margin:10px;
}
.img-box {
	cursor: pointer;
	float: left;
	position: relative;
	overflow: hidden;
}
.img-box img {
	position: absolute;
	left: 0;
		-webkit-transition: all .2s ease-out;
		-moz-transition: all .2s ease-out;
		-o-transition: all .2s ease-out;
		-ms-transition: all .2s ease-out;	
	transition: all .2s ease-out;
}

/* Caption Common Style */
.img-box .caption {
	background-color: rgba(0,0,0,0.8);
	position: absolute;
	color: #fff;
  padding:5px;
	z-index: 100;
		-webkit-transition: all .2s ease-out;
		-moz-transition: all .2s ease-out;
		-o-transition: all .2s ease-out;
		-ms-transition: all .2s ease-out;	
		transition: all .2s ease-out;
	left: 0;
}
/* Top Caption */
.img-box.top-me .caption {
	height: 30px;
	width: 200px;
	display: block;
	top: -40px;
	line-height: 25pt;
}
.img-box.top-me:hover .caption {
	-moz-transform: translateY(100%);
	-o-transform: translateY(100%);
	-webkit-transform: translateY(100%);
	transform: translateY(100%);
  opacity: 1;
}
/** Bottom Caption **/
.img-box.bottom-me .caption {
	height: 30px;
	width: 200px;
	display: block;
	bottom: -40px;
	line-height: 25pt;
}
.img-box.bottom-me:hover .caption {
	-moz-transform: translateY(-100%);
	-o-transform: translateY(-100%);
	-webkit-transform: translateY(-100%);
	opacity: 1;
	transform: translateY(-100%);
}
/* Full Caption up to down */
.img-box.fullup-me .caption {
	width: 170px;
	height: 170px;	
	top: -200px;
	padding: 15px;
}
.img-box.fullup-me:hover .caption {
	-moz-transform: translateY(100%);
	-o-transform: translateY(100%);
	-webkit-transform: translateY(100%);
	opacity: 1;
	transform: translateY(100%);
}
/* Full Caption down to up */
.img-box.fulldown-me .caption {
	width: 170px;
	height: 152px;
	bottom: -182px;
  padding:15px;
}
.img-box.fulldown-me:hover .caption {
	-moz-transform: translateY(-100%);
	-o-transform: translateY(-100%);
	-webkit-transform: translateY(-100%);
	opacity: 1;
	transform: translateY(-100%);
}
/* Fade Caption */
.img-box.fade-me .caption{
	opacity: 0;
	width: 170px;
	height: 170px;
	padding: 15px;
}
.img-box.fade-me:hover .caption {
	opacity: 1;
}
/* Slide Caption from left to right */
.img-box.slide-rl-me .caption {
	width: 170px;
  height: 170px;
  padding: 15px;
  left: 200px;
}
.img-box.slide-rl-me:hover .caption {
	background-color: rgba(0,0,0,1) !important;
  -moz-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  -webkit-transform: translateX(-100%);
  opacity: 1;
  transform: translateX(-100%);
}
.img-box.slide-rl-me:hover img {
	-moz-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
  opacity: 1;  
}
/* Slide Caption from right to left */
.img-box.slide-lr-me .caption {
	width: 170px;
  height: 170px;
  padding: 15px;
  left: -200px;
}
.img-box.slide-lr-me:hover .caption {
	background-color: rgba(0,0,0,1) !important;
  -moz-transform: translateX(100%);
  -o-transform: translateX(100%);
  -webkit-transform: translateX(100%);
  opacity: 1;
  transform: translateX(100%);
}
.img-box.slide-lr-me:hover img {
	-moz-transform: translateX(100%);
  -o-transform: translateX(100%);
  -webkit-transform: translateX(100%);
  transform: translateX(100%);
  opacity: 1;  
}
/* Slide Caption from right to left */
.img-box.slide-tb-me .caption {
	width: 170px;
  height: 170px;
  padding: 15px;
  top: -200px;
}
.img-box.slide-tb-me:hover .caption {
	background-color: rgba(0,0,0,1) !important;
  -moz-transform: translateY(100%);
  -o-transform: translateY(100%);
  -webkit-transform: translateY(100%);
  opacity: 1;
  transform: translateY(100%);
}
.img-box.slide-tb-me:hover img {
	-moz-transform: translateY(100%);
  -o-transform: translateY(100%);
  -webkit-transform: translateY(100%);
  transform: translateY(100%);
  opacity: 1;  
}
/* Slide Caption from right to left */
.img-box.slide-bt-me .caption {
	width: 170px;
  height: 152px;
  padding: 15px;
  bottom: -182px;
}
.img-box.slide-bt-me:hover .caption {
	background-color: rgba(0,0,0,1) !important;
  -moz-transform: translateY(-100%);
  -o-transform: translateY(-100%);
  -webkit-transform: translateY(-100%);
  opacity: 1;
  transform: translateY(-100%);
}
.img-box.slide-bt-me:hover img {
	-moz-transform: translateY(-100%);
  -o-transform: translateY(-100%);
  -webkit-transform: translateY(-100%);
  transform: translateY(-100%);
  opacity: 1;  
}

/* Slide Caption from top to bottom */
.img-box.rotate-me .rotate {
	width: 200px;
	height: 400px;
	-webkit-transition: all 300ms ease-out;
	-moz-transition: all 300ms ease-out;
	-o-transition: all 300ms ease-out;
	-ms-transition: all 300ms ease-out;	
	transition: all 300ms ease-out;
}
.img-box.rotate-me .caption {
	width: 170px;
	height: 170px;	
	text-align: left;
	padding: 15px;
	top: 200px;
	-moz-transform: rotate(-180deg);
	-o-transform: rotate(-180deg);
	-webkit-transform: rotate(-180deg);
	transform: rotate(-180deg);
}
.img-box.rotate-me:hover .rotate {
	background-color: rgba(0,0,0,1) !important;
	-moz-transform: rotate(-180deg);
	-o-transform: rotate(-180deg);
	-webkit-transform: rotate(-180deg);
	transform: rotate(-180deg);
}

/** Caption 6: Scale **/
.img-box.scale .caption  {
	opacity: 0;
	width: 170px;
	height: 170px;
	text-align: left;
	padding: 15px;
}
.img-box.scale .caption h3, 
.img-box.scale .caption p {
	position: relative;
	left: -200px;
	width: 170px;
	-webkit-transition: all 300ms ease-out;
	-moz-transition: all 300ms ease-out;
	-o-transition: all 300ms ease-out;
	-ms-transition: all 300ms ease-out;	
	transition: all 300ms ease-out;
}

.img-box.scale .caption h3 {
	-webkit-transition-delay: 300ms;
	-moz-transition-delay: 300ms;
	-o-transition-delay: 300ms;
	-ms-transition-delay: 300ms;	
	transition-delay: 300ms;
}

.img-box.scale .caption p {
	-webkit-transition-delay: 500ms;
	-moz-transition-delay: 500ms;
	-o-transition-delay: 500ms;
	-ms-transition-delay: 500ms;	
	transition-delay: 500ms;
}
.img-box.scale:hover img {
	-moz-transform: scale(1.4);
	-o-transform: scale(1.4);
	-webkit-transform: scale(1.4);
	transform: scale(1.4);
}
.img-box.scale:hover .caption  {
	opacity: 1;
}
.img-box.scale:hover .caption h3, 
.img-box.scale:hover .caption p {
	-moz-transform: translateX(200px);
	-o-transform: translateX(200px);
	-webkit-transform: translateX(200px);
	transform: translateX(200px);
}
              
            
!

JS

              
                
              
            
!
999px

Console