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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <div class="block">Vertical Centre</div>



Calc Demo Absolute Centre.
Using Calc to always position an element in the absolute centre of the viewport.

This is done by calculating 50vh then removing the height of the element. Only works if you know the height of the container, obviously.

  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: calc( 50vh - 25px );
  width: 200px;
  height: 50px;

boring stuff

:root {
  background-color: #373150;
  font-size: 16px;
  font-weight: 400;
  text-rendering: geometricPrecision;
  line-height: 1.4;
  text-decoration-skip: ink;
  font-family: -apple-system-headline, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

html { 
  box-sizing: border-box;

*, *:before, *:after {
  box-sizing: inherit;

body {

.block {
  border: 1px dashed white;
  color: white;
  font-size: 0.8rem;
  text-align: center;
  line-height: 4em;