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

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="main-container">
  <div class="fixed-container">Fixed Container</div>
  <div class="content-wrapper">
    <!-- ...more content here -->
    <div class="overflow-container">
      <!-- ...and more content here -->
      <div class="overflow-content">
        Overflow Content
        <br/><br/>
        For Non-Chrome browsers (Firefox, Safari, etc):<br/>
        Without <code>min-height:0px;</code> on the content-wrapper,
        this content will not scroll but instead will expand to its 
        full height.
        <br/><br/>
        Note that the setup of the main-container here is important too.
        If its not
        <code>position:absolute; height:100%; flex-direction:column;</code>
        or 
        <code>height:100vh; flex-direction:column;</code>
        then you may not run into this issue;
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                /* a container with flex-direction column */
.main-container {
  height: 75vh; /* or position:absolute; height:100%; */
  display: flex;
  flex-direction: column;
}

/* an arbitrary container of fixed height */
.fixed-container {
  height: 100px;
  padding: 20px;
  background-color: #0B5AB0;
  color: white;
}

/* this is the flex container that will take the rest of the height */
.content-wrapper {
  display: flex;
  flex: 1;
  min-height: 0px; /* IMPORTANT: you need this for non-chrome browsers */
}

/* the container for our overflowed content */
.overflow-container {
  flex: 1;
  overflow: auto;
}

/* the overflow content itself */
.overflow-content {
  height: 2000px;
  color: black;
  background-color: #ddd;
  padding: 20px;
}

code {
  font-weight: bold;
  color: darkred;
  margin: 0 5px;
}
              
            
!

JS

              
                
              
            
!
999px

Console