cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="g g--masonry-2-to3-up">
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/450/200/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/350/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/452/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/250/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/450/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/250/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/555/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/275/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/520/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/310/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/390/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
  <div class="g__item">
    <div class="block">
      <img src="http://lorempixel.com/g/400/550/" alt="" class="block__img" />
      <h2 class="block__title">Lorem ipsum dolar semet</h2>
    </div><!--end block-->
  </div><!--end g__item-->
  
</div><!--end g-->

<section>
  New Section stuff Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit odio consequuntur corrupti facilis perferendis quo quaerat fugiat maxime libero corporis, accusantium saepe, repellendus ratione odit impedit, explicabo mollitia veritatis, nulla.
</section>
            
          
!
            
              /*------------------------------------*\
    #GLOBAL/IRRELEVANT STUFF
\*------------------------------------*/
* {
  box-sizing: border-box;
}

body {
  background: #f8f9f4;
}

section {
  background: #eaefce;
  padding: 4rem 2rem;
}





/*------------------------------------*\
    #BLOCK
\*------------------------------------*/
.block {
  background: #fff;
  border: 1px solid #ddd;
}

.block__title {
  margin: 0;
  padding: 0.5rem;
}

.block__img {
  max-width: 100%;
  width: 100%;
  display: block;
}





/*------------------------------------*\
    #LAYOUT
\*------------------------------------*/

/**
 * Grid object
 * 1) Over-arching grid container
 * 2) Creates overlap effect with content below
 */
.g {
  padding: 0.5rem;
  max-width: 84rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: -3rem; /* 2 */
}

/**
 * 2-to-3-up masonry grid
 * 1) Creates a Pinterest-style, masonry grid with blocks of varying heights.
 * 2) Set number of columns to display
 */
.g--masonry-2-to3-up {
  column-count: 2; /* 2 */
  column-gap: 0;
  
  @media all and (min-width: 40em) {
    column-count: 3; /* 2 */
  }
  
  @media all and (min-width: 56em) {
    column-count: 4; /* 2 */
  }
}

/**
 * Grid item
 * 1) Direct child of the grid container element
 * 2) Prevents content from splitting up because of the 
 *    parent's CSS columns
 */
.g__item {
  padding: 0.5rem;
  -webkit-column-break-inside: avoid; /* 2 */
  page-break-inside: avoid;
  break-inside: avoid;
}
            
          
!
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.
Loading ..................

Console