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.

            
              <div class="container">
  <header>
    <h1>Flexbox Cards Layout</h1>
  </header>
  <ul class="item-list">

    <li class="item item1">
      <img src="http://source.unsplash.com/B1amIgaNkwA/480x320/">
      <div class="item-text">
        <h2>Item 1</h2>
        <p>Curabitur blandit tempus porttitor. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Curabitur blandit tempus porttitor. Etiam porta sem malesuada magna mollis euismod. Integer posuere
          erat a ante venenatis dapibus posuere velit aliquet.</p>
      </div>
    </li>

    <li class="item item2">
      <img src="http://source.unsplash.com/xcC5ozHk_N8/480x320/">
      <div class="item-text">
        <h2>Item 2</h2>
        <p>Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec sed odio dui. Donec sed odio dui. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
      </div>
    </li>
    <li class="item item3">
      <img src="http://source.unsplash.com/mWRR1xj95hg/480x320/">
      <div class="item-text">
        <h2>Item 3</h2>
        <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla vitae elit libero, a pharetra augue. Maecenas faucibus mollis interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id
          nibh ultricies vehicula ut id elit. Maecenas sed diam eget risus varius blandit sit amet non magna. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
      </div>
    </li>
    <li class="item item4">
      <img src="http://source.unsplash.com/yEOCA6oiVqg/480x320/">
      <div class="item-text">
        <h2>Item 4</h2>
        <p>Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Aenean lacinia bibendum nulla sed
          consectetur. Donec sed odio dui.</p>
      </div>
    </li>
    <li class="item item5">
      <img src="http://source.unsplash.com/VB-w_3dnyvI/480x320/">
      <div class="item-text">
        <h2>Item 5</h2>
        <p>Nulla vitae elit libero, a pharetra augue. Maecenas faucibus mollis interdum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Morbi leo risus, porta ac consectetur ac, vestibulum
          at eros. Donec id elit non mi porta gravida at eget metus. Curabitur blandit tempus porttitor.</p>
      </div>
    </li>
    <li class="item item6">
      <img src="http://source.unsplash.com/yOujaSETXlo/480x320/">
      <div class="item-text">
        <h2>Item 6</h2>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed diam eget risus varius blandit sit amet non magna.
   </p>
      </div>
    </li>
    <li class="item item7">
      <img src="http://source.unsplash.com/NKSGuJzExIo/480x320/">
      <div class="item-text">
        <h2>Item 7</h2>
        <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Duis mollis, est non commodo luctus, nisi erat porttitor ligula,
          eget lacinia odio sem nec elit. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec ullamcorper nulla non metus auctor fringilla. Donec sed odio dui.</p>
      </div>
    </li>
    
  </ul>
</div>
            
          
!
            
              @import "compass/css3";

* {box-sizing: border-box;}

body {background-color: #eee;}

.container {
  padding: 1rem 1rem;
  max-width: 1200px;
  min-width: 320px;
  margin: 0 auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;

}
li {
  padding: 1rem; 
  background: #fff;
  color: #202020;
  border-radius: 5px;
  border: 1px solid #ccc;
  opacity: 0.9;
}

li:hover{
box-shadow: 1px 2px 3px 0px rgba(25,25,25,0.6);
opacity: 1;
transition:all 0.5s ease;  
}


h1 {
  background-color: darken(steelblue, 10%);
  color: #fff;
  padding: 1.25rem;
}
h2 {margin: 0;
}
p {
  color: #555; line-height: 1.5;
}
img {
 width: 100%; margin-bottom:1.5rem; border-radius: 5px;
}



/* Flexbox Styling */

/* Inspired by https://www.aaron-gustafson.com/notebook/playing-with-flexbox-and-quantity-queries/ */

.item-list {
  display: flex; 
  flex-wrap: wrap;
  }
.item {
  flex: 100%;
  margin: 0 0 1.25rem;
}

@media (min-width: 36em) {

.item { 
  flex: 0 0 calc( 50% - 1.25rem / 2 );
  margin-left: 1.25rem;
}
 
 .item:nth-child(odd){ 
   margin-left: 0;
 }  
  
}

@media (min-width: 60em) {
.item {flex: 0 0 calc(100% / 3 - 0.875rem);
}
  
.item:nth-child(odd), item:nth-child(even) { 
    margin-left: 1.25rem;
}
  
 .item:nth-child(3n+1) { 
  margin-left: 0;} 
}



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

Console