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

              
                
<div class="wrapper">
	<div class="container">
		<h1>CSS Image Zoom Grid</h1>
		
		<div class="image-zoom-container">
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Costa Rica</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Bavaria</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Firenza</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Zermatt</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Cinque Terre</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Vincenza</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Puerta Vallarta</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Munich</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
			<div class="zoom-container">
				<a href="#">
					<span class="zoom-caption">
						<h3>Roma</h3>
					</span>
					<img src="http://lorempixel.com/g/767/510/" />
				</a>
			</div>
		</div>
		<!--/.image-zoom-container-->
		
		<hr />
		
		<p class="centered">Demo by <a href="http://alijafarian.com">Ali Jafarian</a></p>
	</div>
	<!--/.container-->
</div>
              
            
!

CSS

              
                * {
	margin: 0;
	padding: 0;
}
body {
	background: url(../images/texture_subtle_grunge.jpg);
	font-family: 'Helvetica Neue', arial, sans-serif;
	font-weight: 200;
}

h1 {
	font-family: 'font-family: 'Source Sans Pro', sans-serif;', sans-serif;
	font-size: 4em;
	font-weight: 900;
	letter-spacing: -3px;
	margin: 0 0 20px;
	text-align: center;
	text-shadow: 1px 1px 0 #fff, 2px 2px 0 #bbb;
}
hr {
	border-top: 1px solid #ccc;
	border-bottom: 1px solid #fff;
	margin: 25px 0;
	clear: both;
}
.centered {
	text-align: center;
}
.wrapper {
	width: 100%;
	padding: 30px 0;
}
.container {
	width: 1200px;
	margin: 0 auto;
}

/* ---------- Zoom container ---------- */
.image-zoom-container {
	list-style: none;
	font-size: 0px;
}
.zoom-container {
	position: relative;
	overflow: hidden;
	display: inline-block;
	width: 33.33%; /* this value + 2 should = 33% */
	font-size: 16px;
	font-size: 1rem;
	border: 1px solid #fff;
	vertical-align: top;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
}
.zoom-container img {
	display: block;
	width: 100%;
	height: auto;
	-webkit-transition: all .5s ease; /* Safari and Chrome */
    -moz-transition: all .5s ease; /* Firefox */
    -ms-transition: all .5s ease; /* IE 9 */
    -o-transition: all .5s ease; /* Opera */
    transition: all .5s ease;
}
.zoom-container .zoom-caption {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 10;
	background: rgba(0, 0, 0, .5);
	-webkit-transition: all .5s ease; /* Safari and Chrome */
    -moz-transition: all .5s ease; /* Firefox */
    -ms-transition: all .5s ease; /* IE 9 */
    -o-transition: all .5s ease; /* Opera */
    transition: all .5s ease;
}
.zoom-container .zoom-caption h3 {
	display: block;
	text-align: center;
	font-family: 'Source Sans Pro', sans-serif;
	font-size: 1.5em;
	font-weight: 900;
	letter-spacing: -1px;
	text-transform: uppercase;
	color: #fff;
	margin: 23% 0 0;
	padding: 10px 0;
	border-top: 5px solid rgba(255, 255, 255, .15);
	border-bottom: 5px solid rgba(255, 255, 255, .15);
}
.zoom-container:hover img {
	-webkit-transform:scale(1.25); /* Safari and Chrome */
    -moz-transform:scale(1.25); /* Firefox */
    -ms-transform:scale(1.25); /* IE 9 */
    -o-transform:scale(1.25); /* Opera */
     transform:scale(1.25);
}
.zoom-container:hover .zoom-caption {
	background: none;
}

@media (max-width: 1199px) {
	.container {
		width: auto;
		padding: 0 10px;
	}
}

@media (max-width: 767px) {

	.zoom-container {
		width: 50%;
	}

}

@media (max-width: 480px) {
	
	.zoom-container {
		width: 100%;
	}
	
}
              
            
!

JS

              
                
              
            
!
999px

Console