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

            
              <div class="supports"></div>

<ul class="grid">
			<li class="title">
				<h2>
					Some Balloons
				</h2>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq5.jpg" alt="balloons">
          The Pattersons Balloon
          
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq1.jpg" alt="balloons">
          The Hardy's wine balloon, launching alongside a nice checked one.
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq3.jpg" alt="balloons">
          Virgin looking a bit skew.
				</div>
			</li>
			<li class="title">
				<h2>
					More balloons
				</h2>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq12.jpg" alt="balloons">
          The Swatch balloon
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq11.jpg" alt="balloons">
          Fortnum and Mason. What we know about this one is that it uses the correct Pantone colour.
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq10.jpg" alt="balloons">
          This one is quite snazzy.
				</div>
			</li>
			<li class="title">
				<h2>
					What do you know? Balloons!
				</h2>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq9.jpg" alt="balloons">
          Top of a balloon
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq8.jpg" alt="balloons">
          Lots of balloons
				</div>
			</li>
			<li>
				<div>
					<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq7.jpg" alt="balloons">
          Wahey!
				</div>
			</li>

		</ul>
            
          
!
            
              .grid {
  overflow: hidden;
  padding: 0.5em 0 0 0.5em;
  max-width: 56em;
  margin: 0 auto 20px auto;
  list-style: none;
}

.grid li {
  padding: 0 0.5em 0.5em 0;
}

.grid li img {
  display: block;
}

.grid h2 {
  font-size: 100%;
}

.grid li > div,
.grid li > h2 {
  background: #808080;
  color: #fff;
  text-align: center;
  margin: 0;
}

.grid li.title h2 {
  padding: 1em;
  width: 100%;
}

.grid li a {
  color: #fff;
}

@media all and (min-width: 500px) {
  .grid li {
    float: left;
    width: 33.3333333%;
  }
  .grid li.title {
    width: 100%;
  }
}

@media all and (min-width: 60em) {
  .grid li {
    width: 25%;
  }
  .grid li.title {
    width: 25%;
    clear: left;
  }
  .grid li.title h2 {
    padding: 7em 2em;
  }
}


/* for flexbox */

@supports(display: flex) {
  @media all and (min-width: 500px) {
    .grid {
      display: flex;
      flex-wrap: wrap;
    }
    .grid li {
      display: flex;
      flex-direction: column;
    }
    /* the original pattern and therefore our fallback styles uses padding on the li and then puts the background color on the inner element. We can't therefor make it stretch just by way of the default alignment of the flex item. By setting the li to a flex column we can then make the inner grow to the height of the external container.  */
    .grid li > * {
      flex: 1;
    }
  }
}


/* for grid */

@supports(display: grid) {

 
  @media all and (min-width: 500px) {
    .grid {
      display: grid;
    grid-gap: 15px;
    padding-right: 10px;
      grid-template-columns: repeat(3, 1fr);
    }
    .grid li {
      padding: 0;
    display: block;
    background: #808080;
      float: none;
      width: auto;
    }
    .grid li.title {
      width: auto;
      grid-column: 1 / 4;
    }
  }
  @media all and (min-width: 60em) {
    .grid {
      grid-template-columns: repeat(4, 1fr);
    }
    .grid li {
      width: auto;
    }
    .grid li.title {
      grid-column: 1 / 2;
    }
  }
}
            
          
!
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