cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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 V1</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{
    // prevent module blocks from breaking apart
    // but can be buggy & columns appear uneven
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid; 
    break-inside: avoid; 
    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
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console