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

              
                <p>Small font sizes fail in WebKit and Opera when used with ems or %. In WebKit this happens when the base font-size is set in ems or %. In Opera this happen when the font-size is set to the equivalent of 1px in ems.<p>
<p>All of the blue bars below should be 1px tall, but as you can see the first two are 6px tall when view with WebKit. All of the orange bars should be 6px tall but the first two render as 36px in WebKit.<p>

<div class="small">
  <div class="em">
    <span></span>
  </div>
  <div class="percent">
    <span></span>
  </div>
  <div class="pt">
    <span></span>
  </div>
  <div class="px">
    <span></span>
  </div>
</div>
  
<div class="large">
  <div class="em">
    <span></span>
  </div>
  <div class="percent">
    <span></span>
  </div>
  <div class="pt">
    <span></span>
  </div>
  <div class="px">
    <span></span>
  </div>
</div>
              
            
!

CSS

              
                .em      { font-size: 1em;  /* 16px */ }
.percent { font-size: 100%; /* 16px */ }
.pt      { font-size: 12pt; /* 16px */ }
.px      { font-size: 16px; /* 16px */ }

.small span, .large span {
  display: block;
  font-size: 0.0625em; /* 1px */
  height: 1em;         /* 1px */
  background-color: #00f;
}

.large span {
  height: 6em;         /* 6px */
  background-color: #f90;
}

.em, .percent, .pt, .px {
  margin-bottom: 10px; /* Space the lines out */
}
              
            
!

JS

              
                
              
            
!
999px

Console