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 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.


                <div class="container">
  <div class="box">This box is located vertically in the golden ratio of the container element.</div>


/* Here is where the magic happens */
.container {
  display: flex; /* we need the flex technique */
  flex-direction: column; /* and we need it vertically */
  align-items: center; /* horizontally we just center the box */

.container::before {
  content: " ";
  flex-grow: .38196601; /* This is the magic number that places the box vertically in the golden ratio */
/* That's it!! */
/* except you want to place it relatively to the viewport - see below, where we position the container element */

/* To place the container at the golden ratio of the viewport, we need to set the height of "html" and "body" to 100% and margin to 0. Then we use the same technique as we used for the box. */
body {
  height: 100%;
  margin: 0;

body {
  display: flex;
  flex-direction: column;
  align-items: center;

body::before {
  content: " ";
  flex-grow: .38196601;

/* The rest are just a few environmental and styling settings */

.container {
  border: #000 solid 1px;
  height: 20em;
  width: 30em;
  margin: 0 auto;

.box {
  width: 10em;
  padding: 1em;
  border-radius: .5em;
  box-shadow: 0 0 1em rgba(0, 0, 0, .5);
  text-align: center;