Pen Settings



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


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.


                <h1>Understanding Ems</h1>

<p>An em always looks to its parent.</p>

<p>The wrapper here is set to 62.5% font size (effecitively 10px)</p>

<p>The h1 is set to 1.8em, so 10 * 1.8 = 18px</p>

<p>If we set the span (that sits inside the H1) to have a font-size of 1.6em, it is based on its context (container) so we get 1.8 * 1.6 which gives us 2.88/29px </p>

<p>To solve the issue you need 'target / context = result'. In this instance 1.6/1.8 = .888888889. So to get a 16px height, we set font-size to .888888889em (set on '.fixed')</p> 

<div class="wrapper">
  <h1 class="h1">Headline should be?
    <span>What do you expect setting 1.6em here  to do?</span>
    <span class="fixed">fixed</span>


                .wrapper {
  font-size: 62.5%;

.h1 {
  font-size: 1.8em;

span {
  font-size: 1.6em;

.fixed {
  font-size: .888888889em;