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

              
                <main>
  <div class="wrapper">
    <article class="flow">
      <h1>Margin shorthand</h1>
      <figure class="callout">
        <p>
          If you only define one value for <code>margin</code>, it’ll apply margin to
          all sides. If you define two values for <code>margin</code>, the first value
          will be applied to the top and bottom (block) sides and the second value
          will be applied to the left and right (inline) sides. If you define three
          values for <code>margin</code>, the first value is <code>top</code>, the
          second value is <code>left</code> <strong>and</strong>
          <code>right</code> and the third value is <code>bottom</code>.
        </p>
      </figure>
      <div class="container">
        <div class="all-sides">I have <code>margin: 20px;</code>.</div>
      </div>
      <div class="container">
        <div class="two-sides">I have <code>margin: 20px 40px;</code>.</div>
      </div>
      <div class="container">
        <div class="three-sides">I have <code>margin: 20px 40px 30px;</code>.</div>
      </div>
    </article>
  </div>
</main>
              
            
!

CSS

              
                .all-sides {
  margin: 20px;
}

.two-sides {
  margin: 20px 40px;
}

.three-sides {
  margin: 20px 40px 30px;
}

/* presentational styles */

.container {
  max-width: 400px;
  background: var(--color-primary-x-light);
  border: 1px solid var(--color-primary);
}

.container > * {
  border: 1px solid var(--color-stroke);
  background: white;
  padding: 1rem;
}

              
            
!

JS

              
                
              
            
!
999px

Console