123

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              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
            
          
!
            
              @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;
}


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console