Pen Settings

HTML

CSS

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

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

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.

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

              
                <ul class="image-grid">
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(https://media.timeout.com/images/101602611/image.jpg)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">Los Angeles</div>
		</a>
	</li>
	
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(http://s1.it.atcdn.net/wp-content/uploads/2015/08/2-London.jpg)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">London</div>
		</a>
	</li>	
	
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(https://media.timeout.com/images/101484105/image.jpg)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">New York</div>
		</a>
	</li>	
	
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Hollywood_Sign.jpg/1280px-Hollywood_Sign.jpg)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">Hollywood</div>
		</a>
	</li>	
	
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(http://www.travelandleisure.com/sites/default/files/styles/tnl_redesign_article_landing_page/public/1453920892/DUBAI-554088081-ABOVE0116.jpg?itok=dcoZnCrc)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">Dubai</div>
		</a>
	</li>	
	
  <li class="image-grid__item">
		<a href="#" class="grid-item">
			<div class="grid-item__image" style="background-image: url(http://blog.whitepages.com/wp-content/uploads/2015/04/san-franc.jpg)"></div>
			<div class="grid-item__hover"></div>
			<div class="grid-item__name">San Fransisco</div>
		</a>
	</li>		
</ul>
              
            
!

CSS

              
                // Variables =============================================================
$font-family: "Open Sans", Helvetica, Arial, sans-serif

// Mixins ================================================================
=absolute($top, $left, $right, $bottom)
	position: absolute
	top: $top
	left: $left
	right: $right
	bottom: $bottom

// Colors ================================================================

// Base colors
$background-light: #F3F4F8
$background-dark: #2F3032
$border-light: darken($background-light, 2%)
$border-dark: darken($background-dark, 2%)

// Base ==================================================================
*:not(i)
	font-family: $font-family

html
	height: 100%
	font-size: 16px

body
	height: 100%
	background: $background-light


// Styles =================================================================

.image-grid
	display: flex
	flex:
		direction: row
		wrap: wrap
	align:
		content: center
		items: center
	justify-content: center
	max-width: 80%
	height: 100%
	margin: 0 auto
	padding: 0
	list-style: none

.image-grid__item
	display: flex
	flex:
		direction: column
		grow: 0
		shrink: 0
		basis: 360px
	align-items: stretch
	justify-content: center
	position: relative
	height: 220px
	margin-right: 14px
	margin-bottom: 14px
	transition: transform 0.14s ease-in, text-shadow 0.1s ease-in

	// Pseudo elements ------------------
	&:before
		content: ''
		visibility: hidden
		+absolute(0,0,0,0)
		background: none
		border-radius: 3px
		box-shadow: 0 10px 24px 0px rgba(0,0,0,0.06), 0 8px 20px -2px rgba(0,0,0,0.10), 0 6px 10px -6px rgba(0,0,0,0.20)
		transition: visibility 0.1s ease-out, opacity 0.1s ease-out
		opacity: 0

	// CSS state ------------------------
	&:hover

		&:before
			visibility: visible
			opacity: 1
	
.grid-item
	display: flex
	position: relative
	flex:
		direction: column
		grow: 1
		shrink: 1
	align-items: stretch
	justify-content: center
	text:
		decoration: none
	color: #eeeeee
	overflow: hidden

	// CSS state ------------------------
	&:hover
		.grid-item__image
			transform: scale(1.2)

		.grid-item__hover
			visibility: visible
			opacity: 1		

		.grid-item__name
			visibility: visible
			transform: scale(1)
			opacity: 1
			

.grid-item__image
	+absolute(0,0,0,0)
	background:
		size: cover
		position: center center
	transform: scale(1)
	will-change: transform
	transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94)
	z-index: 0

.grid-item__hover
	visibility: hidden
	display: block
	+absolute(0,0,0,0)
	background: radial-gradient(transparentize($background-dark, 0.8), transparentize($background-dark, 0.3))
	box-shadow: inset 0 0 50px rgba(0,0,0,0.15)
	border-radius: 0
	transition: visibility 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94)
	opacity: 0


.grid-item__name
	visibility: hidden
	display: flex
	flex:
		direction: column
		grow: 1
		shrink: 1
	align-items: center
	font:
		size: 2rem
		weight: 300	
	text:
		shadow: 0px 0px 30px rgba(0,0,0,0.40), 2px 2px 6px rgba(0,0,0,0.3)
	justify-content: center
	letter-spacing: 1px
	transform: scale(0.6)
	transform-origin: center center
	transition: visibility 0.14s ease-out, opacity 0.14s ease-out, transform 0.24s ease
	opacity: 0
		
              
            
!

JS

              
                
              
            
!
999px

Console