Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <h2>Columns example</h2>
<div class="features">
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error aperiam consectetur quasi ratione quas assumenda accusamus sapiente exercitationem suscipit distinctio ipsum excepturi dolorum sint cum hic illo mollitia asperiores unde?</p>
  </article>
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error aperiam consectetur quasi ratione quas assumenda accusamus sapiente exercitationem suscipit distinctio ipsum excepturi dolorum sint cum hic illo mollitia asperiores unde?</p>
  </article>
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error aperiam consectetur quasi ratione quas assumenda accusamus sapiente exercitationem suscipit distinctio ipsum excepturi dolorum sint cum hic illo mollitia asperiores unde?</p>
  </article>
</div>

<h2>Vertical align example</h2>
<div class="products">
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus dolor odit nihil beatae tempore vitae ad perspiciatis libero eligendi rerum quae suscipit fugit aspernatur reprehenderit quisquam provident deserunt minima consequuntur.</p>
  </article>
  
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
  </article>
  
  <article>
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus dolor odit nihil beatae tempore vitae ad perspiciatis libero eligendi rerum quae suscipit fugit aspernatur reprehenderit quisquam provident deserunt minima consequuntur.</p>
  </article>
</div>

<h2>Fluid example</h2>
<div class="compare">
  <article class="fluid">
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati harum quisquam ut illo iste velit cumque tempore eligendi eveniet debitis incidunt vitae illum ducimus magnam fugiat dicta nemo nihil quaerat.</p>
  </article>
  <article class="fluid">
    <h3>Lorem ipsum</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia corrupti quas libero aliquid consequuntur necessitatibus molestiae harum ea eaque placeat nobis voluptatibus tempora et cumque delectus numquam at ratione non!</p>
  </article>
</div>
              
            
!

CSS

              
                @import "compass/css3";

// Make sure you have this in your styles
// because grid is using paddings
*, *:before, *:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

// This is mixin which you will include in parent
// of columns. It kills default margin of inline-block
// elements.
@mixin row () {
  font-size: 0;
}

// This is column mixins.
@mixin col ($col, $sum, $gap: 1em, $align: top, $first: false, $last: false) {
    width: 100%;
    display: inline-block;
    font-size: 16px;
    padding-left: if($first, 0, $gap);
    padding-right: if($last, 0, $gap);

    @media only screen and (min-width: 768px) {
            width: percentage($col/$sum);
            vertical-align: $align;
    }

    &.fluid { width: percentage($col/$sum); }
}

h2 { margin-top: 0; }

.features, .products, .compare {
  @include row;
  margin-bottom: 50px;
}

.features article {
  @include col(1, 3);
}

.products article {
  background: #eee;
  @include col(1, 3, $align: middle);
}

.compare article {
  @include col(1, 2);
}
              
            
!

JS

              
                
              
            
!
999px

Console