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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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
Loading ..................

Console