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

              
                h2 Single sidebar layout

.single-sidebar.layout
	.header header
	.nav nav
	.content content
	.subscribe subscribe
	.footer footer

h2 Double sidebar layout

.double-sidebar.layout
	.header header
	.nav nav
	.subscribe subscribe
	.content content
	.sidebar sidebar
	.footer footer

              
            
!

CSS

              
                /* autoprefixer grid: on */

/* header.scss */
.header {
  grid-area: header;
  /* The rest of the header styles */
}

/* nav.scss */
.nav {
  grid-area: nav;
  /* The rest of the nav styles */
}

/* sidebar.scss */
.sidebar {
  grid-area: sidebar;
  /* The rest of the sidebar styles */
}

/* content.scss */
.content {
  grid-area: content;
  /* The rest of the content styles */
}

/* subscribe.scss */
.subscribe {
  grid-area: subscribe;
  /* The rest of the subscribe styles */
}

/* footer.scss */
.footer {
  grid-area: footer;
  /* The rest of the footer styles */
}

/* layout.scss */
.single-sidebar {
  grid-template:
    "header    header" 1fr
    "nav       content" 1fr
    "subscribe content" 1fr
    "footer    footer" 1fr /
		 1fr       2fr;

	height: 500px;
	width: 500px;
	border-color: crimson;

	> * {
		border-color: crimson;
	}
}

.double-sidebar {
  grid-template:
    "header header    header" 1fr
    "nav    content   sidebar" 1fr
    "nav    subscribe sidebar" 1fr
    "footer footer    footer" 1fr /
		1fr     2fr       1fr;

	border-color: navy;

	> * {
		border-color: navy;
	}
}

.layout {
  display: grid;
	height: 500px;
	width: 500px;
	margin: auto;
	border-width: 5px;
	border-style: solid;

	> * {
  	border-width: 1px;
	  border-style: dashed;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 1.3em;
		font-weight: bold;
		padding: 10px;
	}
}

h2 {
	text-align: center;
}

body {
	margin: 20px;
}

              
            
!

JS

              
                
              
            
!
999px

Console