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

              
                h3 Column wrapping
p Issues when you add more cols than a row can fit
.row
  .col-xs-6.col-sm-3
    |  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo repudiandae doloremque necessitatibus aliquam culpa soluta vel, et ullam vero, ut at. Saepe quam, maiores impedit iste officia, officiis veniam unde!
  .col-xs-6.col-sm-3
    | lorem
  .col-xs-6.col-sm-3
    | lorem
  .col-xs-6.col-sm-3
    | lorem
 
h3 Responsive column resets
.row
  .col-xs-6.col-sm-3
    |  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo repudiandae doloremque necessitatibus aliquam culpa soluta vel, et ullam vero, ut at. Saepe quam, maiores impedit iste officia, officiis veniam unde!
  .col-xs-6.col-sm-3
    | lorem
  .clearfix.visible-xs-block 
  .col-xs-6.col-sm-3
    | lorem
  .col-xs-6.col-sm-3
    | lorem   

h3 Responsive column resets: 2,4,6
p Doable, but increasinly ugly...
.row
  .col-xs-6.col-sm-3.col-md-2
    |  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo repudiandae doloremque necessitatibus aliquam culpa soluta vel, et ullam vero, ut at. Saepe quam, maiores impedit iste officia, officiis veniam unde!
  .col-xs-6.col-sm-3.col-md-2
    | lorem
  .clearfix.visible-xs-block 
  .col-xs-6.col-sm-3.col-md-2
    | lorem
  .col-xs-6.col-sm-3.col-md-2
    | lorem   
  .clearfix.visible-sm-block        
  .clearfix.visible-xs-block
  .col-xs-6.col-sm-3.col-md-2
    | lorem
  .col-xs-6.col-sm-3.col-md-2
    | lorem       


h3 Custom grid usign nth-child clears
p Easy to roll your own. N number of items without splitting into 'rows' and adding clearfixes...
.grid-container-with-nth-clears
  .grid-element 
    | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores quasi illo sed nisi fuga ut, id tempora, quisquam nesciunt eveniet totam quis corporis libero pariatur dolorum sunt natus odit delectus!
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem     
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
 
h3 Custom grid using inline-blocks
p No need of clears, some font-size hack..
.grid-container-with-inline-block
  .grid-element 
    | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores quasi illo sed nisi fuga ut, id tempora, quisquam nesciunt eveniet totam quis corporis libero pariatur dolorum sunt natus odit delectus!
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem     
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
    
h3 Custom grid using flexbox (align-items: flex-start)
.grid-container-flex-start
  .grid-element 
    | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores quasi illo sed nisi fuga ut, id tempora, quisquam nesciunt eveniet totam quis corporis libero pariatur dolorum sunt natus odit delectus!
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem     
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
    
h3 Custom grid using flexbox (align-items: flex-stretch)
.grid-container-flex-stretch
  .grid-element 
    | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores quasi illo sed nisi fuga ut, id tempora, quisquam nesciunt eveniet totam quis corporis libero pariatur dolorum sunt natus odit delectus!
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem     
  .grid-element
    | lorem
  .grid-element
    | lorem
  .grid-element
    | lorem
              
            
!

CSS

              
                @import "bourbon";

[class^=col-], .grid-element{
  border: 1px solid rgb(107, 142, 35);
  background: rgba(107, 142, 35, 0.8);
}

.grid-container-with-nth-clears{
  @include clearfix;
  margin-right: -15px;
  margin-left: -15px;  

  .grid-element{
    min-height: 1px;
    position: relative;
    padding: 0 15px;
    @media (max-width:768px){
      float:left;
      width: 50%;
      &:nth-child(2n+1){
        clear:left;
      }    
    }
    @media (min-width: 768px) and (max-width:992px){
      float:left;
      width: 25%;
      &:nth-child(4n+1){
        clear:left;
      }    
    }
    @media (min-width: 992px){
      float:left;
      width: (100%/6);
      &:nth-child(6n+1){
        clear:left;
      }    
    }  
  }
}

.grid-container-with-inline-block{
  font-size:0;
  margin-right: -15px;
  margin-left: -15px;  

  .grid-element{
    display:inline-block;        
    vertical-align: top;
    font-size: 14px;
    min-height: 1px;
    position: relative;
    padding: 0 15px;
    @media (max-width:768px){
      width: 50%;  
    }
    @media (min-width: 768px) and (max-width:992px){
      width: 25%;  
    }
    @media (min-width: 992px){
      width: (100%/6);   
    }  
  }
}

.grid-container-flex-start, .grid-container-flex-stretch{
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  margin-right: -15px;
  margin-left: -15px;    
  .grid-element{
    min-height: 1px;
    position: relative;
    padding: 0 15px;
    @media (max-width:768px){
      width: 50%;  
    }
    @media (min-width: 768px){
      width: 25%;
    }
    @media (min-width: 992px){
      width: (100%/6);
    }  
  }  
}

.grid-container-flex-start{
  align-items: flex-start;
}

.grid-container-flex-stretch{
  align-items: flex-stretch;
}


              
            
!

JS

              
                
              
            
!
999px

Console