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

              
                <div class="desc"><p>Using px for font size overrides the font size the users might have set in their OS/browser. We force the user to zoom manually instead of letting the interface scale automatically to their needs and preferences.<p>
  <p>Adjust the base font-size percent in the CSS to simulate how user-set font sizes affect the layout</p>
  <p>Zooming != scaling.</p>
</div>

<div class="pxrem">1rem font in 256px wide div</div>
<div class="rem16rem">1rem font in 16rem wide div</div>

<div class="pixels">16px font in 512px wide div</div>
<div class="rems">1rem font in 32rem wide div</div>

<div class="pixels"><div class="rempx">16px font in 32rem wide div in 512px wide div</div></div>
<div class="rems"><div class="remrem">1rem font in 32rem wide div in 32rem wide div</div></div>

              
            
!

CSS

              
                /* Adjust the base font-size percent to simulate how user-set font sizes affect the layout */
html {
  font-size: 150%; /* Change this to 100 and 200 and see the difference */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
  padding: 1vmax 3vmax;
}

.desc {
  margin-bottom: 1rem;
  max-width: 42rem;
}

div {
  margin: 1vmin 0;
  padding: 0.5em 0;
  box-sizing: border-box;
}

.rems {
  background-color: hsl(120, 10%, 76%);
  width: 32rem;
}

.rem16rem {
  font-size: 1rem;
  background-color: hsl(120, 10%, 86%);
  width: 16rem;
}

.remrem {
  font-size: 1rem;
  background-color: hsl(120, 10%, 86%);
  width: 32rem;
}

.pixels {
  background-color: hsl(12, 10%, 68%);
  width: 512px;
  font-size: 16px;
}

.rempx {
  font-size: 16px;
  background-color: hsl(12, 10%, 78%);
  width: 32rem;
}

.pxrem {
  font-size: 1rem;
  background-color: hsl(12, 10%, 78%);
  width: 256px;
}

              
            
!

JS

              
                
              
            
!
999px

Console