Pen Settings



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


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


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.


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.


                <!-- percent doesn't take into account the gap -->
<div class="grid percent">
  <p class="one">50% of the width each</p>
  <p class="two">will horizontal scroll, doesn't consider the grid-gap</p>

<!-- no horizontal scroll -->

<div class="grid fr">
  <p class="one">No horizontal scroll with 1fr 1fr</p>
  <p class="two">creates two equal width items, regardless of content</p>

<div class="grid auto">
  <p class="one">No horizontal scroll with auto auto. Calculates the min width for both, then divides the rest of the space evenly to both sections</p>
  <p class="two">auto acts like 1fr</p>

<div class="grid auto-fr">
  <p class="one">auto is shy, shrinks down to the min-width when there's an fr</p>
  <p class="two">fr is greedy, takes as much as it can</p>

<h1><a href="">Blog post</a></h1>

  <li>Calculates the min size for all auto items</li>


                /* auto will behave exactly like 1fr  */

li {
  font-size: 1.5rem;

.grid {
  display: grid;
  grid-gap: 3rem;

.percent {
  grid-template-columns: 50% 50%;

.fr {
  grid-template-columns: 1fr 1fr;

.auto {
  grid-template-columns: auto auto;

.auto-fr {
  grid-template-columns: auto 1fr;

.one {
  background-color: lightgreen;

.two {
  background-color: lightblue;