css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console