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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <main class="mason">

  <article class="tile">

    <div class="image"></div>

    <h1>Title One</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum, pariatur suscipit veniam fugit.</p>

  </article>

  <article class="tile">

    <div class="image"></div>

    <h1>Title Two</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto.</p>

  </article>
  
  <article class="tile">

    <div class="image"></div>

    <h1>Title Three</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum, pariatur suscipit veniam fugit explicabo expedita consequatur est. Quasi, soluta! Lorem, ipsum dolor sit amet consectetur adipisicing elit.</p>

  </article>

  <article class="tile">

    <div class="image"></div>

    <h1>Title Four</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum.</p>

  </article>

  <article class="tile">

    <div class="image"></div>

    <h1>Title Five</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum, pariatur suscipit. Lorem, ipsum dolor sit amet consectetur adipisicing elit.</p>

  </article>

  <article class="tile">

    <div class="image"></div>

    <h1>Title Six</h1>

    <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum, pariatur suscipit veniam fugit explicabo expedita consequatur est. Quasi, soluta!</p>

   </article>

   <article class="tile">

     <div class="image"></div>

     <h1>Test Seven</h1>

     <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Id, voluptatem. Corrupti amet architecto tempora harum deserunt consequuntur error commodi cum, pariatur suscipit veniam fugit explicabo expedita consequatur est. Quasi, soluta! Lorem, ipsum dolor sit amet consectetur adipisicing elit.</p>

  </article>
  
</main>
              
            
!

CSS

              
                * {
  box-sizing: border-box
}

body {
  background: #F8F8F8
}

body,
h1,
p {
  padding: 0;
  margin: 0;
}

h1 {
  padding: 18px 18px 0;
  margin-bottom: 0.5em;
}

p {
  padding: 0 18px 18px;
  line-height: 1.5;
}

.mason {
  /*  Masonry Rules  */
  column-count: 2;
  
  @media (min-width:540px) {
    column-count: 3;
  }
  
  @media (min-width:768px) {
    column-count: 4;
  }
  
  /*  Stylistic Rules  */
  column-gap: 18px;
  padding: 18px;
}

.tile {
  /*  Masonry Rules  */
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  
  /*  Stylistic Rules  */
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.1);
  border-bottom-width: 3px;
  background: #fff;
}

.image {
  width: 100%;
  background: turquoise
}

.image::before {
  content: "";
  display: block;
  padding-top: 50%
}
              
            
!

JS

              
                
              
            
!
999px

Console