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.


  <img src="">

  <section class="bfc">
    <h1>Secrets of the BFC</h1>
    <button id="toggle">What?</button>
    <h2>What's happening?</h2>
    <blockquote>Floats, absolutely positioned elements, inline-blocks, table-cells, table-captions, and elements with ‘overflow’ other than ‘visible’... establish new block formatting contexts.</blockquote>
    <p>Clicking the "What?" button simply toggles on and off <code>overflow: hidden</code> on this section. It creates a new block formatting context, which wraps cleanly with floated elements. You can achieve similar results with <code>display: table-cell</code>. All good.</p>


                .bfc {
  overflow: hidden;

img {
  float: left;

/* fluff */
body { margin: 0; line-height: 1.38; } button { font-size: 16px; padding: 0.5em 1em; background: blue; color: white; border: 0; border-radius: 5px; cursor: pointer; } main { max-width: 900px; margin: 1rem auto; } h1 { margin-top: 0; margin-bottom: 1rem; } blockquote { font-style: italic; border-left: 2px solid lightgray; margin-left: 0; padding-left: 2rem; } section { padding-left: 1rem; }



                var bfc = document.querySelector('.bfc')
var btn = document.getElementById('toggle')

btn.addEventListener('click', function() {