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.

            
              <header class="header"/>
  <h1>CSS Columns V2</h1>
</header>

<div class="grid">
  
  <div class="module">
    <img src="http://placehold.it/750x850?text=IMG"/>
    <h3>Lorem Ipsum</h3>
    <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores.</p>
  </div>

  <div class="module">
    <ul>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
    </ul>
  </div>

  <div class="module">
    <ul>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
      <li class="media">
        <div><img src="http://placehold.it/750x750?text=IMG"/></div>
        <h3>Lorem Ipsum</h3>
      </li>
    </ul>
  </div>
    
  <div class="module">
    <img src="http://placehold.it/950x550?text=IMG"/>
    <h3>Lorem Ipsum</h3>
    <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores.</p>
  </div>
  
  <div class="module">
    <img src="http://placehold.it/750x450?text=IMG"/>
    <h3>Lorem Ipsum</h3>
    <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores.</p>
  </div>
  
  <div class="module">
    <img src="http://placehold.it/750x950?text=IMG"/>
    <h3>Lorem Ipsum</h3>
    <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores.</p>
  </div>
  
</div>

<footer class="footer">
  <p>Bottom of the page</p>
</footer>
            
          
!
            
              // Column Grid CSS
.grid{
  width: 96%;
  max-width: 1500px;
  margin: 3% auto;
  @media screen and (min-width: 310px){
    // set a minimum suggested width
    column-width: 300px;
    // set a max number of columns
    column-count: 3;
    column-gap: 2.5em;
  }

  .module{
    @media screen and (min-width: 310px){
      // swapping out break-inside: avoid; for this…
      // but noticing a lot of extra whitespace below the grid
      display: inline-block; 
    }
    overflow: hidden;
    min-width: 300px;
    width: 100%;
    background: #f5f5f5;
    padding: 1em;
    box-sizing: border-box;
    margin-bottom: 3em;
  }
}

// Base Styling
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,900');

html, body{
  margin: 0;
}

body{
  line-height: 1.6;
  font-family: 'Source Sans Pro', sans-serif;
  color: #333;
}

h1, h2{
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.55rem;
  line-height: 1.25em;
  font-weight: 900;
  margin: 0;
}

h3{
  font-weight: 900;
  margin-bottom: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul{
  padding: 0;
  margin: 0;
  li{
    margin-bottom: 1em;
  }
}

p{
  margin-top: 0;
}

header, footer{
  background: #333;
  text-align: center;
  color: white;
  padding: calc(4vh + 2em);
  h1{
    font-size: 4vw;
  }
  p{
    margin-bottom: 0;
  }
}
footer{
  margin-bottom: 0;
  padding: 2vh;
}

.media {
  display: flex;
  h3 {
    padding-left: 1rem;
    padding-right: 1rem;
    margin: auto 0;
  }
  img{
    max-width: 100px;
  }
}




            
          
!
999px
Loading ..................

Console