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

              
                <!-- <html> (already included) -->
<!-- <body> (already included) -->


<header class='site-header'>
  <div class='inner-column'>
    <h1>Hi.</h1>
  </div>
</header>


<main class='page-content'>

  <section class='welcome'>
    <div class='inner-column'>
      <h2>OK. So, this "page-content" section has <code>grow: 1;</code> on it. That means "YES" try and grow. (well, it <em>really</em> means take up 1 fraction of the available space)</h2>
    </div>
  </section>
  
  <section class='other'>
    <div class='inner-column'>
      <h2>Other bit</h2>
    </div>
  </section>

</main>


<footer class='site-footer'>
  <div class='inner-column'>
    <h2>Footer</h2>
    
    <nav class='menu'>
      <a href="#">Menu link a</a>
      <a href="#">Menu link a</a>
      <a href="#">Menu link a</a>
    </nav>
  </div>
</footer>


<!-- </body> (already included) -->
<!-- </html> (already included) -->
              
            
!

CSS

              
                /* ^ reset included */
* {
  box-sizing: border-box;
}

.inner-column {
  width: 70vw;
  max-width: 800px; /* especially small for CodePen example! */
  margin-right: auto;
  margin-left: auto;
}


/* SPECIFIC TO THE GROW  "stick footer" (that isn't really sticky) */
body {
  display: flex; /* so the childred can listen to flex rules */
  flex-direction: column;
  min-height: 100vh; /* so there's something to stretch to */
}
.page-content {
  flex-grow: 1; 
  /* "true" grow to stretch  
    (you can think of it that way for now) 
  */
  border: 4px solid red;
}
/* This is all dependent on the situation / child elements directly within the body */
























































































































/* this is NOT for you! */

html {
  --width: 4px;
  --space: 10px;
}

body {
  color: rgba(255, 255, 255, .4);
}

nav a {
  display: inline-block;
  padding: 4px;
}

a {
  color: inherit;
}

main, body {
  display: flex;
  flex-direction: column;
  gap: 10px
}

html {
  border: var(--width) solid var(--pe-red);
  padding: var(--space);
  background-color: #4d4d4d;
}

body {
  border: var(--width) solid var(--pe-cyan);
  padding: var(--space);
}

header {
  border: var(--width) solid var(--pe-orange);
  padding: var(--space);
}

section {
  border: var(--width) solid var(--pe-green);
  padding: var(--space);
}

footer {
  border: var(--width) solid var(--pe-yellow);
  padding: var(--space);
}

div {
  border: var(--width) solid var(--pe-blue);
  padding: var(--space);
}

div > * {
  border: var(--width) solid #979797;
  padding: var(--space);
}

nav > * {
  border: var(--width) solid #979797;
  padding: var(--space);
}

div > * + * {
  margin-top: var(--space);
}

              
            
!

JS

              
                
              
            
!
999px

Console