cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              
<div class="wrapper roundedCorners">
	
	<div class="main">
		<h1 class="pageTitle">Image gallery</h1>
		<h2 class="pageSubtitle">With caption fom data tags</h2>
		<p>A nice image gallery with animated caption drawn from the image data tags. Made with CSS3 for modern browsers. Less modern browsers or non-browser
		(like Internet Explorer) may encounter problems with showing the layout correctly.</p>
	</div>

</div>

<ul class="top">
	<li class="galleryItem">
		<a class="caption"
	    href="#"
	    data-title="Colored landscape"
	    data-description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id sapien condimentum, sagittis erat rhoncus, bibendum nisi.">
	 
	    	<img src="http://media.digitalcameraworld.com/files/2012/10/Vertorama_landscape_photography_tips_PHO17.insight02and03.vertorama.jpg" alt="Landscape image">
		
		</a>
	</li>
	
	<li class="galleryItem">
		<a class="caption"
	    href="#"
	    data-title="Black &amp; white photo"
	    data-description="Vivamus ut sem id magna consequat porta vitae ut sem. Proin eget commodo risus, vitae blandit velit. ">
	 
	    	<img src="http://media.digitalcameraworld.com/files/2012/11/Black_and_white_landscape_photography_DCM131.shoot_creative.main_image_RGB.jpg" alt="Landscape image">
		
		</a>
	</li
	
</ul>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Titillium+Web:400,600,700,300,200);

@import url(https://fonts.googleapis.com/css?family=Croissant+One);


@import url(https://fonts.googleapis.com/css?family=Poiret+One);

*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html {
	background: #E4E4E4;
}

body {
	padding: 1px;
	font-family: 'Titillium Web', sans-serif;
	font-size: 16px;
	font-weight: 300;
	line-height: 22px;
  color: #666;
}

h1,
h2,
h3 {
	font-weight: 600;
}

a {
	text-decoration: none;
}

/* TITLES
===================================================== */
.pageTitle {
	display: block;
	margin: 0 0 0.2em 0;
	font-size: 2.2em;
	line-height: 1em;
	color: #3CA0D0;
}

.pageSubtitle {
	display: block;
	margin: 0 0 0.4em 0;
	font-size: 1.4em;
	line-height: 1em;
	color: #333;
}

/* EFFECTS
===================================================== */
.roundedCorners {
	-webkit-border-radius: 5px;
    border-radius: 5px;
}

.roundedCornersTop {
	-webkit-border-radius: 5px 5px 0 0;
    border-radius: 5px 5px 0 0;
}

.roundedCornersBottom {
	-webkit-border-radius: 0 0 5px 5px;
    border-radius: 0 0 5px 5px;
}

.boxShadow {
	-webkit-box-shadow:  0px 0px 5px 0px rgba(0, 0, 0, 0.25);
	box-shadow:  0px 0px 5px 0px rgba(0, 0, 0, 0.25);
}

/* LAYOUT
===================================================== */
.wrapper {
	width: 600px;
	margin: 20px auto;
}

	.top {
		width: 100%;
		min-height: 300px;
		padding: 20px 0;
		text-align: center;
	}
	
	.main {
		width: 96%;
		padding: 2% 2% 5% 2%;
    margin: 5% 0;
		background: none;
    border-bottom: solid 1px #ccc;
	}
	
	.footer {
		width: 96%;
		padding: 2%;
		background: #222;
		border-top:
			solid
			3px
			#086FA1;
	}
	
/* GALLERY
===================================================== */
.galleryItem {
	display: inline-block;;
	position: relative;
  width: 250px;
  height: 250px;
  padding: 0;
	margin: 0 20px;
}

.galleryItem img {
	width: 100%;
	height: 100%;
  border: solid 10px #fff;
}

.caption {
	position: relative;
  overflow: hidden;
	display: inline-block;
	width: 250px;
	height: 250px;
	z-index: 10;
}

.caption::before {
	content: attr(data-title);
	position: absolute;
	top: -50%;
	left: 0;
	width: 100%;
	height: 50%;
  padding: 10px;
  font-family: 'Croissant One', cursive;
	font-size: 1.8em;
	font-weight: 600;
	line-height: 1.4em;
	color: #086FA1;
	background: #fff;
	overflow: hidden;
	
	-webkit-transition: all 0.3s ease;
	-moz-transition: all 0.3s ease;
	-ms-transition: all 0.3s ease;
	-o-transition: all 0.3s ease;
	transition: all 0.3s ease;
}

.caption::after {
	content: attr(data-description);
	position: absolute;
	bottom: -50%;
	left: 0;
	width: 100%;
	height: 50%;
  padding: 10px;
  font-family: 'Poiret One', cursive;
	font-size: .9em;
	font-weight: 400;
	line-height: 1.4em;
	color: #fff;
	background: #222;
	overflow: hidden;
	
	-webkit-transition: all 0.3s ease;
	-moz-transition: all 0.3s ease;
	-ms-transition: all 0.3s ease;
	-o-transition: all 0.3s ease;
	transition: all 0.3s ease;
}

.caption:hover::before {
	top: 0;
}

.caption:hover::after {
	bottom: 0;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console