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

              
                .grid-wrapper
	.grid
		.grid-cell
		.grid-cell
		.grid-cell
		.grid-cell
		.grid-cell
		.grid-cell

              
            
!

CSS

              
                /* Allows the use of px units on borders */
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

.grid-wrapper {
	/* Prevents odd margin behaviour in Chrome */
	overflow: hidden;
}

.grid {
  /* forces equal cell heights */
  display: flex;
  flex-wrap: wrap;

  /* creates an equal outer gap (optional) */
  padding: 20px 0 0 20px;

  /* pulls grid cells hard against edges */
  margin: -20px;

	/* Alternate margin if not including padding */
  // margin: 0 -20px -20px 0;
}

.grid-cell {
  /* sets column count */
  width: calc(100% / 1); /* 1 column by default */

  /* creates gaps */
  border: 0 solid transparent;
  border-width: 0 20px 20px 0;
	
	/* prevents background bleed */
	background-clip: padding-box;
}

@media (min-width: 400px){
	.grid-cell {
    width: calc(100% / 2); /* 2 columns */
	}
}

@media (min-width: 600px){
	.grid-cell {
    width: calc(100% / 3); /* 3 columns */
	}
}


/************************************\
  Prettiness only below this point
\************************************/

.grid-cell {
	/* So that we can see the grid cells */
	box-shadow: inset 0 0 0 1px #000;
	height: 100px;
	
	/* For displaying the color coding */
	// outline: 2px dashed yellow;
	// border-color: hsla(0, 100%, 35%, 1);

	&:nth-child(1){
		background-color: hotpink;
	}
}

.grid {
	/* For displaying the color coding */
	// padding: 0;
	// border: 0 solid hsla(210, 100%, 50%, 1);
	// border-width: 20px 0 0 20px;
}

.grid-wrapper {
	/* So that we can see the edges of the grid */
	box-shadow: 0 0 10px 2px green;

	max-width: 500px;
	margin: 30px auto;
}

html {
	margin: 20px;
}
              
            
!

JS

              
                
              
            
!
999px

Console