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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="container">
    <h2>Float grid</h2>
<div class="float-grid">
<div class="float-grid-col float-grid-4">
  sidebar
  </div>  
  <div class="float-grid-col float-grid-8">
      <p>Main body copy demonstrating how the sidebar height does not change as I get taller.</p>
    <ul>
    <li>List item</li>
      <li>List item</li>
      <li>List item</li>
    </ul>
  </div>  
</div>  
   <h2>Flexbox grid</h2>
  <div class="row">
  <div class="col-sm-4">
  sidebar
    </div>
    <div class="col-sm-8">
          <p>Main body copy demonstrating how the sidebar height changes as I get taller.</p>
    <ul>
    <li>List item</li>
      <li>List item</li>
      <li>List item</li>

    </ul>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {margin:2rem;}
h2 {margin:2rem 0;}
.col-sm-4, .col-sm-8, .float-grid-col  {border:4px solid #ccc;}

.float-grid {overflow: hidden;    margin-right: -15px;
    margin-left: -15px;}
.float-grid-col {float:left;    padding-right: 15px;
    padding-left: 15px;}
.float-grid-4 {width:33%;}
.float-grid-8 {width:67%;}

@media screen and (max-width: 480px) {
  .float-grid-col {float:none;width:100%;}
}
              
            
!

JS

              
                $(document).ready(function() {
 // executes when HTML-Document is loaded and DOM is ready
console.log("document is ready");
  
  
// document ready  
});


$(window).load(function() {
 // executes when complete page is fully loaded, including all frames, objects and images
console.log("window is loaded");
  
  
// window load  
});
              
            
!
999px

Console