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

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

              
                <div class="container">
	<div class="cards">
		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/200/animals);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				A summary will also be present. Usually two to three brief sentences about the content on the detail page.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>

		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/640/480/nature);">
				<span class="card-title">
					<h3>This is a title for a card that is a bit longer in length</h3>
				</span>
			</span>
			<span class="card-summary">
				Each card is created from an &lt;a&gt; tag so the whole card is linked.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>
		
		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/400/people)">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				Using Flexbox is such a an easy, well supported way for grid-style content, such as cards. The cards height will expand to match the longest item.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>

		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/200/tech);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				A summary will also be present. Usually two to three brief sentences about the content on the detail page.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>
		
		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/200/people);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				Each card is created from an &lt;a&gt; tag so the whole card is linked.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>
		
		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/250/nature);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				Using Flexbox is such a an easy, well supported way for grid-style content, such as cards. The cards height will expand to match the longest item.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>

		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/250/animals);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				A summary will also be present. Usually two to three brief sentences about the content on the detail page.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>

		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/600/600/people);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				Each card is created from an &lt;a&gt; tag so the whole card is linked.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>

		<a class="card" href="#">
			<span class="card-header" style="background-image: url(http://placeimg.com/400/400/tech);">
				<span class="card-title">
					<h3>This is a title for a card</h3>
				</span>
			</span>
			<span class="card-summary">
				Using Flexbox is such a an easy, well supported way for grid-style content, such as cards. The cards height will expand to match the longest item.
			</span>
			<span class="card-meta">
				Published: June 18th, 2015
			</span>
		</a>
	</div>
</div>
              
            
!

CSS

              
                @import "compass";
@import "breakpoint";

//Center Content
.container {
	max-width: 1100px;
	margin: 0 auto;
}
//Todo clean up some crappy code
.cards {
	display: -webkit-flex;
	display: flex;
	-webkit-justify-content: center;
	justify-content: center;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;
	margin-top: 15px;
	padding: 1.5%;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

.card {
	@media (max-width: 700px) {
		width: 100%;
	}
	position: relative;
	margin-bottom: 20px; 
	padding-bottom: 30px; 
	background: #fefff9;
	color: #363636; //the whole content of the card becomes linked, so this will give the text a "norma;" appearance
	text-decoration: none;
	@include box-shadow(rgba(black, 0.19) 0 0 8px 0);
	@include border-radius(4px);
	@include breakpoint(700px, $no-query: true) {
	//switch to 2 columns
		max-width: 320px;
		margin-right: 20px;
		margin-bottom: 20px;
		&:nth-child(even) {
			margin-right: 0;
		}
	}
	@include breakpoint(980px, $no-query: true) {
	//switch to 3 columns
		&:nth-child(even) {
			margin-right: 20px;
		}
		&:nth-child(3n) {
			margin-right: 0;
		}
	}
	span {
		display: block;
	}
	.card-summary {
		padding: 5% 5% 3% 5%;
	}
	.card-header {
		position: relative;
		height: 175px;
		overflow: hidden;
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center;
		background-color: rgba(white,.15);
 		background-blend-mode: overlay;
		@include border-radius(4px 4px 0 0);
		&:hover, &:focus {
			background-color: rgba(white, 0);
		}
	}
	.card-title {
		background: rgba(157, 187, 63, .85);
		padding: 3.5% 0 2.5% 0;
		color: white;
		font-family: 'Roboto Condensed', sans-serif;
		text-transform: uppercase;
		position: absolute;
		bottom: 0;
		width: 100%;
		h3 {
			font-size: 1.2em;
			line-height: 1.2;
			padding: 0 3.5%;
			margin: 0;
		}
	}
	.card-meta {
		max-height: 0;
		overflow: hidden;
		color: #666;
		font-size: .78em;
		text-transform: uppercase;
		position: absolute;
		bottom: 5%;
		padding: 0 5%;
		@include transition-property(max-height);
		@include transition-duration(.4s);
		@include transition-timing-function(ease-in-out);
	}
	&:hover, &:focus {
		background: white;
	  @include box-shadow(rgba(black, 0.45) 0px 0px 20px 0px);
		.card-title {
			background: rgba(157, 187, 63, .95);
		}
		.card-meta {
			max-height: 1em;
		}
	}
}

img {
	max-width: 100%; // stop images from breaking out of their bounding boxes.
}

//General styles for page to make it prettier ;P
body {
	background :#f0f0f0;
	font-size: 17px; 
	line-height: 1.4;
	font-family: 'Jaldi', sans-serif;
}

* {
  @include transition-property(
    background-color,
    border-color,
    box-shadow,
    color,
    opacity,
    text-shadow,
    transform
  );
  @include transition-duration(0.2s);
  @include transition-timing-function(linear);
}
              
            
!

JS

              
                
              
            
!
999px

Console