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.


  <h1>The Trick of Using Flexbox to Put Footer at The Bottom</h1>

    <p>This <code>article</code> block element's <code>margin-left</code> is set to <code>auto</code>, so the left margin take up all the avaible space on the left of <code>article</code>, just like the <code>margin-top: auto;</code> on the <code>footer</code> which is the child of a Flexbox.</p>
<footer>&copy; A footer at the bottom.</footer>


                :root {
  --gap: 1rem;

* {
  box-sizing: border-box;

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: monospace;
  display: flex;
  flex-direction: column;

header, main, footer {
  padding: var(--gap);

header {
  background-color: royalblue;
  color: white;

main {
  border: 4px solid yellowgreen;

article {
  width: 600px;
  border: 1px dashed hotpink;
  padding: var(--gap);
  margin-left: auto;
  font-size: 1.5rem;
  line-height: 1.5;

p code {
  font-family: inherit;
  border-radius: 3px;
  padding: 3px 6px;
  background-color: #e3e5e8;

footer {
  background-color: rebeccapurple;
  color: white;
  margin-top: auto;


                // This is the further explore on this article: