123

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.

            
              <h1>Grid with Quantity Queries</h1>
<ol class="listing listing--events">
  				<li class="listing__item listing__item--1 event event--future">
    							<a href="http://lanyrd.com/2015/web-sherpa-summit/">
      			<h3 class="listing__item__title event__title">Web Sherpa Summit</h3>
      	<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Online</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--2 event event--future">
    		<a href="http://uxim15.uie.com/">
      		<h3 class="listing__item__title event__title">UX Mobile Immersion</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Salt Lake City, UT USA</b>
      			</p>
  		  </a>
  		</li>
  <li class="listing__item listing__item--3 event event--future">
    		<a href="http://lanyrd.com/2015/convergese/">
      		<h3 class="listing__item__title event__title">Converge SE</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Columbia, SC USA</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--4 event event--future">
    		<a href="http://lanyrd.com/2015/bdconf/">
      		<h3 class="listing__item__title event__title">Breaking Development</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Nashville, TN USA</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--5 event event--future">
    		<a href="http://www.webdesignday.com/">
      		<h3 class="listing__item__title event__title">Web Design Day</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Pittsburgh, PA USA</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--6 event event--future">
    		<a href="http://lanyrd.com/2015/responsive-day-out-3/">
      		<h3 class="listing__item__title event__title">Responsive Day Out</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Brighton, England</b>
      </p>
    	</a>
		  </li>
  <li class="listing__item listing__item--7 event event--future">
    		<a href="http://lanyrd.com/2015/dcontentconf/">
      		<h3 class="listing__item__title event__title">Design/Content</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">August 2015</b>
        				<b class="event__location">Vancouver, BC Canada</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--8 event event--future">
    <a href="http://aneventapart.com/event/washington-dc-2015">
		      <h3 class="listing__item__title event__title">An Event Apart</h3>
			      <p class="listing__item__meta">
				        <b class="event__date">August 2015</b>
				        <b class="event__location">Washington, DC USA</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--9 event event--future">
		    <h3 class="listing__item__title event__title">TBA</h3>
    <p class="listing__item__meta">
      <b class="event__date">November 2015</b>
      <b class="event__location">New York, NY USA</b>
    			</p>
  		</li>
  <li class="listing__item listing__item--10 event event--future">
    		<h3 class="listing__item__title event__title">TBA</h3>
			    <p class="listing__item__meta">
      				<b class="event__date">November 2015</b>
      				<b class="event__location">Malmö, Sweden</b>
    			</p>
				  </li>
</ol>

<h1>Normal Grid</h1>
<ol class="listing listing--events">
  				<li class="listing__item listing__item--1 event">
    							<a href="http://lanyrd.com/2015/web-sherpa-summit/">
      			<h3 class="listing__item__title event__title">Web Sherpa Summit</h3>
      	<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Online</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--2 event">
    		<a href="http://uxim15.uie.com/">
      		<h3 class="listing__item__title event__title">UX Mobile Immersion</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Salt Lake City, UT USA</b>
      			</p>
  		  </a>
  		</li>
  <li class="listing__item listing__item--3 event">
    		<a href="http://lanyrd.com/2015/convergese/">
      		<h3 class="listing__item__title event__title">Converge SE</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">April 2015</b>
        				<b class="event__location">Columbia, SC USA</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--4 event">
    		<a href="http://lanyrd.com/2015/bdconf/">
      		<h3 class="listing__item__title event__title">Breaking Development</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Nashville, TN USA</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--5 event">
    		<a href="http://www.webdesignday.com/">
      		<h3 class="listing__item__title event__title">Web Design Day</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Pittsburgh, PA USA</b>
      			</p>
    		</a>
  		</li>
  <li class="listing__item listing__item--6 event">
    		<a href="http://lanyrd.com/2015/responsive-day-out-3/">
      		<h3 class="listing__item__title event__title">Responsive Day Out</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">June 2015</b>
        				<b class="event__location">Brighton, England</b>
      </p>
    	</a>
		  </li>
  <li class="listing__item listing__item--7 event">
    		<a href="http://lanyrd.com/2015/dcontentconf/">
      		<h3 class="listing__item__title event__title">Design/Content</h3>
      			<p class="listing__item__meta">
        				<b class="event__date">August 2015</b>
        				<b class="event__location">Vancouver, BC Canada</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--8 event">
    <a href="http://aneventapart.com/event/washington-dc-2015">
		      <h3 class="listing__item__title event__title">An Event Apart</h3>
			      <p class="listing__item__meta">
				        <b class="event__date">August 2015</b>
				        <b class="event__location">Washington, DC USA</b>
      			</p>
		    </a>
		  </li>
  <li class="listing__item listing__item--9 event">
		    <h3 class="listing__item__title event__title">TBA</h3>
    <p class="listing__item__meta">
      <b class="event__date">November 2015</b>
      <b class="event__location">New York, NY USA</b>
    			</p>
  		</li>
  <li class="listing__item listing__item--10 event">
    		<h3 class="listing__item__title event__title">TBA</h3>
			    <p class="listing__item__meta">
      				<b class="event__date">November 2015</b>
      				<b class="event__location">Malmö, Sweden</b>
    			</p>
				  </li>
</ol>
            
          
!
            
              body {
  padding: 1em;
}

.listing--events {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 0 0 1em;
  padding: 0;
}
 
.event {
  background: rgb(26, 88, 18);
  color: rgb(249, 249, 249);
  text-shadow: 1px 1px 1px rgb(26, 88, 18);
  box-sizing: border-box;
  padding: 1.25rem;
  margin: 0 0 1.25rem;
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;
}

.event a {
  color: white;
}
 
@media only screen and (min-width: 28.75em) {
  
  .event {
    flex: 0 0 calc( 50% - 1.25rem / 2 );
    /* 20px gap divided by 2 events per row */
    margin-left: 1.25rem;
  }
  
  /* Remove left margin for row starters */
  .event:nth-child(odd) {
    margin-left: 0;
  }
  
  /* Reset margins on "future" events
     & remove the correct one */
  .event--future:nth-child(odd) {
    margin-left: 1.25rem;
  }
  .event--future:nth-child(even) {
    margin-left: 0;
  }
  
  /* Quantity Query - when more than 1,
     make the first span both columns  */
  .event--future:nth-last-child(n+1):first-child {
    flex: 0 0 100%;
    font-size: 1.5em;
    margin-left: 0;
  }

}
 
@media only screen and (min-width: 43.125em) {

  /* 1/3 width with a 20px gutter (fudged) */
  .event {
    flex: 0 0 calc( 100% / 3 - 0.875rem );
  }
  
  /* Reset margins */
  .event:nth-child(even),
  .event:nth-child(odd) {
    margin-left: 1.25rem;
  }
  /* Normal Grid margin removal */
  .event:nth-child(3n+1) {
    margin-left: 0;
  }

  /* Quantity Query - when more than 2,
     make the first 2 go 50%  */
  .event--future:nth-last-child(n+2):first-child, 
  .event--future:nth-last-child(n+2):first-child + .event--future {
    flex: 0 0 calc( 50% - 1.25rem / 2  );
    font-size: 1.5em;
  }
  
  /* Margin reset */
  .event--future:nth-child(3n+1) {
    margin-left: 1.25rem;
  }
  
  /* Quantity + nth */
  .event--future:nth-last-child(n+2):first-child ~ .event--future:nth-child(3n) {
    margin-left: 0;
  }
  
}
            
          
!
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.

Console