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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <header>
		<h1 class="page-title">CSS Grid Layout using @supports with Flexbox fallback</h1>
</header>
<main>
	<div class="intro">
		<h1 class="post-title">How about an interesting post title with and initial-letter because we can</h1>
	</div>
	<div class="byline">
		<p class="meta">by Stacy Kvernmo published 3 days ago</p>
	</div>
	<div class="social">
		<a class="twitter-share-button"
  href="https://twitter.com/intent/tweet?text=Hello%20world"
  data-size="large"><span class="fa fa-twitter"></span></a>
		
		<a href="https://facebook.com/#"><span class="fa fa-facebook-square"></span></a>

		<a href="https://plus.google.com/#"><span class="fa fa-google-plus-square"></span></a>
	</div>
	
	<div class="summary">
		<h3>TL;DR Summary</h3>
		<p>Let's pretend this is a short summary of this post content.</p>
	</div>
	
	<div class="post-content">
		<!-- CSS Grid Layout browser support text -->
		[[[https://codepen.io/stacy/pen/f1639a51a21481925379ac4580c6fe2e]]]			
	
		<p>Content goes here in this container. <strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p> 
		<p>Senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui in turpis pulvinar facilisis.</p>

	</div>
</main>

<!-- Support Message -->
[[[https://codepen.io/stacy/pen/NbvaNY]]]
            
          
!
            
              main {
	display: flex;
	flex-wrap: wrap;
	
	@include bp('large') {
		justify-content: flex-end;
	}
	
	@supports (display: grid) {
		display: grid;
		grid-gap: 1rem;
		grid-template-columns: 1fr 1fr;
		
		@include bp('large') {
			grid-template-columns: repeat(4, 1fr);
		}
	}
}

.intro {
	@include bp('large') {
		flex: 0 0 calc(50% - 3rem);
		margin-left: calc(25% - 3rem);
	}
	
	@supports (display: grid) {
		grid-column: 1 / span 2;

		@include bp('large') {
			grid-column: 2 / span 2;
			margin-left: 0.5rem;
		}
	}
}

.summary {
	@include bp('large') {
		order: 1;
	}

	@supports (display: grid) {
		grid-column: 1 / span 2;

		@include bp('large') {
			grid-column: 4 / span 1;
		}
	}
}

.post-content {	
	@supports (display: grid) {
		grid-column: 1 / span 2;

		@include bp('large') {
			grid-column: 2;
		}
	}
	
	@include bp('large') {
		flex: 0 0 calc(50% - 3rem);

		@supports (display: grid) {
			grid-column: 2 / span 2;
		}
	}
}	

.byline,
.social {
	flex: 0 0 calc(50% - 3rem);
	
	@include bp('large') {
		@supports (display: flex) {
			flex: 0 0 calc(25% - 3rem);
		}		
	}
}



/* // Styles for fun
// ------------------------------------------------- */

@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,700');


body {
	background: #fff;
	color: hsl(235, 9%, 39%);
	font-family: 'Open Sans', sans-serif;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	margin: 1rem;
}

div {
	margin: 0.5rem;
	padding: 0 1rem;

	@include bp('large') {
		@supports (display: flex) {
			flex: 0 0 calc(25% - 3rem);
		}		
	}

	&:hover {
		background-color: hsl(347, 12%, 98%);
	}
}

.page-title {
	color: hsl(320, 60%, 30%);
	font-size: calc(3rem + .25vw);
	font-weight: 700;
	line-height: 1.3;
	margin: 1rem auto;
	max-width:  calc(70rem + .25vw);
	text-align: center;
}

.post-title {
	font-weight: 300;
	line-height: 1.3;
	margin-bottom: 0;
	margin-top: 0;
	
	@supports (initial-letter: 2) or (-webkit-initial-letter: 2) {
		&:first-letter {
			color: hsl(320, 60%, 30%);
			font-weight: 700;
			initial-letter: 2;
			-webkit-initial-letter: 2;
		}
	}
}

h2 {
	line-height: 1.2;
}

p,
.social a,
h3 {
	margin-top: 1rem;
}

a {
	color: hsl(330, 50%, 50%);

	&:hover {
		color: hsl(334, 62%, 30%);
	}
}

.social {
	display: flex;
	justify-content: flex-end;

	a {
		font-size: 1.5rem;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}
}

.meta {
	font-family: Georgia, serif;
	font-size: calc(0.7rem + 0.25vw);
	font-style: italic;
}
            
          
!
999px
Loading ..................

Console