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.


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.


                <div class="module-1">I'm element with margin-bottom: -50px.</div>
<div class="module-2">I'm element with margin-top: 100px.</div>

<p>You can select these elements in DevTools to see their vertical margin behaviour.<br><b>The resulting margin between elements is 50px</b>.</p>


                /* We must be carefuel when we count negative values */

.module-1 {
  margin-bottom: -50px;

.module-2 {
  margin-top: 100px;

/* ====================================================
  Below is code, that is not important for this example 

* {
  box-sizing: border-box;

body {
font-family: -apple-system, BlinkMacSystemFont,
    “Segoe UI”, “Roboto”, “Oxygen”, “Ubuntu”, “Cantarell”,
    “Fira Sans”, “Droid Sans”, “Helvetica Neue”,
* {
  box-sizing: border-box;
div {
  display: block;
  width: 100%;
  font-size: 1.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  margin-bottom: 50px;
  background-color: white;
  border: 5px solid black;

p {
   background: #e8f0fe;
  border: 1px solid #3740ff;
  color: #272eb5;
  padding: 10px 20px;
  line-height: 1.8;