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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="grid">
	<div class="grid__fig">
	</div>
	<div class="grid__heading">
		<h1>CSS Layout News</h1>
	</div>
	<div class="grid__btn">
		<a href="http://csslayout.news/" target="_blank">Subscribe</a>
	</div>
	<aside class="grid__sidebar">
		<h3>This week’s news</h3>
		<ul class="sidebar__list">
			<li class="sidebar__item">
				<a href="https://www.smashingmagazine.com/2018/04/best-practices-grid-layout/?utm_campaign=CSS%2BLayout%2BNews&utm_medium=web&utm_source=CSS_Layout_News_142" target="_blank">Best Practices With CSS Grid Layout</a>
			</li>
			<li class="sidebar__item">
				<a href="https://blogs.igalia.com/mrego/2018/04/04/getting-rid-of-grid-prefix-on-css-grid-layout-gutter-properties/" target="_blank">Getting rid of the “grid-” prefix</a>
			</li>
			<li class="sidebar__item">
				<a href="https://meowni.ca/posts/float-layout/?utm_campaign=CSS%2BLayout%2BNews&utm_medium=web&utm_source=CSS_Layout_News_142" target="_blank">How browsers position floats</a>
			</li>
		</ul>
	</aside>
</div>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
}

:root {
	--col: calc(
			( var(--wrapper) - 
			( (var(--numberOfColumns) - 1) * var(--gutter) ) ) / var(--numberOfColumns) ); // unfortunately we can’t put this in a Sass function, because the variable takes the raw value, so the function is never executed
	--gutter: 1em;
	--wrapper: 1100px;
	--numberOfColumns: 12;
	
	@media (min-width: 1600px) {
		--wrapper: 1400px;
	}
}

h1 {
	@media (min-width: 25em) {
		font-size: 5em;
		line-height: 1;
	}
}

h3 {
	@media (min-width: 25em) {
		font-size: 1.8em;
	}
}

ul {
	padding: 0;
	list-style: none;
	
	@media (min-width: 25em) {
		font-size: 1.2em;
	}
}

a {
	text-decoration: none;
	color: #961883;
	transition: color 200ms ease-in-out;
	
	&:hover,
	&:focus {
		color: black;
	}
}

li:not(:last-child) {
	margin-bottom: 1em;
}

.grid {
	@media (min-width: 600px) {
		display: grid;
		grid-template-columns: [start] minmax(20px, 1fr) [wrapper-start] repeat(8, minmax(0, var(--col))) [sidebar-start] repeat(4, minmax(0, var(--col))) [wrapper-end] minmax(20px, 1fr) [end];
		grid-template-rows: minmax(3em, 1fr) auto minmax(auto, 1fr);
		grid-gap: var(--gutter);
		min-height: 100vh;
	}
}

.grid::after {
	content: '';
	display: block;
	grid-column: sidebar-start / end;
	grid-row: 1 / 4;
	background-color: rgba(#f405ed, 0.5);
}

.grid__heading {
	grid-column: wrapper-start / span 6;
	grid-row: 2;
	border: 3px solid;
	padding: 1em;
}

.grid__sidebar {
	grid-column: span 3 / wrapper-end;
	grid-row: 2;
	padding: 1em 0;
	border-top: 3px dotted;
	border-bottom: 3px dotted;
	z-index: 1;
}

.grid__btn {
	grid-column: wrapper-start / sidebar-start;
	grid-row: 3;
	align-self: flex-end;
}

.grid__btn a {
	padding: 1em 1.5em;
	background-color: #f405ed;
	border-radius: 0.25em;
	display: inline-block;
	margin-bottom: 1em;
	
	&:hover,
	&:focus {
		background-color: darken(#f405ed, 10%);
	}
}

.grid__fig {
	grid-column: start / end;
	grid-row: 1 / 4;
	max-height: 900px;
	background-color: #e5dbe5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23f405ed' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}



              
            
!

JS

              
                
              
            
!
999px

Console