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.

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

            
              <div class="cards">
  <div class="card">
    <h2 class="card__title">
      Some really important news takes place
    </h2>
    <img class="card__image" src="https://source.unsplash.com/o0kbc907i20/900x600" alt="Government monument building">
    <div class="card__body">
      <div class="card__taxon">
        <svg class="card__clock-icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 1)" fill="none" fill-rule="evenodd"><circle cx="5" cy="5" r="5"/><path d="M5 1.667V5M6.667 6.667L5 5" stroke-linecap="round"/></g></svg>
        <p class="card__publish">Posted: Apr. 10, 2018 at 10:38 a.m.</p>
      </div>
      <p class="card__summary">Earlier today, this super important thing happened that is going to change everything. You won&rsquo;t even believe how much this thing will matter forever going forward.</p>
      <a href="#0" class="card__cta">Read more &rarr;</a>
    </div>
  </div>
  <div class="card">
    <h2 class="card__title">
      Other extra special stuff occurs
    </h2>
    <img class="card__image" src="https://source.unsplash.com/45sjAjSjArQ/900x600" alt="Busy stairs in large building">
    <div class="card__body">
      <div class="card__taxon">
        <svg class="card__clock-icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 1)" fill="none" fill-rule="evenodd"><circle cx="5" cy="5" r="5"/><path d="M5 1.667V5M6.667 6.667L5 5" stroke-linecap="round"/></g></svg>
        <p class="card__publish">Posted: Apr. 8, 2018 at 5:23 p.m.</p>
      </div>
      <p class="card__summary">In a suprising turn of events, this unexpected event took place and shocked the world.</p>
      <a href="#0" class="card__cta">Read more &rarr;</a>
    </div>
  </div>
  <div class="card">
    <h2 class="card__title">
      Very significant announcement made
    </h2>
    <img class="card__image" src="https://source.unsplash.com/DurC25GdOvk/900x600" alt="Rows of voting seats in political building">
    <div class="card__body">
      <div class="card__taxon">
        <svg class="card__clock-icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 1)" fill="none" fill-rule="evenodd"><circle cx="5" cy="5" r="5"/><path d="M5 1.667V5M6.667 6.667L5 5" stroke-linecap="round"/></g></svg>
        <p class="card__publish">Posted: Apr. 7, 2018 at 6:42 a.m.</p>
      </div>
      <p class="card__summary">Jargony jargon was communicated widely to a boring commmitee on Thursday.</p>
      <a href="#0" class="card__cta">Read more &rarr;</a>
    </div>
  </div>
  <div class="card">
    <h2 class="card__title">
      Leader loudly declares decision
    </h2>
    <img class="card__image" src="https://source.unsplash.com/aNSniQXO424/900x600" alt="News photographers documenting event">
    <div class="card__body">
      <div class="card__taxon">
        <svg class="card__clock-icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 1)" fill="none" fill-rule="evenodd"><circle cx="5" cy="5" r="5"/><path d="M5 1.667V5M6.667 6.667L5 5" stroke-linecap="round"/></g></svg>
        <p class="card__publish">Posted: Apr. 6, 2018 at 4:54 p.m.</p>
      </div>
      <p class="card__summary">Do people even read beyond the headlines anymore? Hello? Anyone?!?</p>
      <a href="#0" class="card__cta">Read more &rarr;</a>
    </div>
  </div>
</div>
            
          
!
            
              @use postcss-nested;

@import url("https://fonts.googleapis.com/css?family=Poppins:200,300,800");

html {
  font-family: "Poppins";
}

body {
  padding: 20px;
}

.cards {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

.card {
  display: grid;
  grid-row-gap: 20px;
  align-items: start;
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  
  @media (max-width: 639px) {
    margin: 0 0 20px;
  }
  
  @media (max-width: 899px) {
    width: 300px;
    grid-template-areas:
      "card__image card__image card__image"
      ". card__title ."
      ". card__body .";
    grid-template-columns: 20px 1fr 20px;
  }
  
  @media (min-width: 640px) and (max-width: 899px) {
    margin: 0 10px 20px;
  }
  
  @media (min-width: 900px) {
    margin: 0 0 20px;
    padding: 20px 20px 0 20px;
    width: 100%;
    grid-template-areas:
      "card__title card__image"
      "card__body  card__image";
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 1fr 3fr;
    grid-column-gap: 20px;
  }
}

.card__image {
  max-width: 100%;
  grid-area: card__image;
}

.card__title {
  margin: 0;
  grid-area: card__title;
  font-weight: 800;
  line-height: 1.1;
  
  @media (min-width: 900px) {
    font-size: 28px;
  }
}

.card__body {
  grid-area: card__body;
}

.card__taxon {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 200;
  color: #888;
}

.card__clock-icon {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  stroke: #888;
}

.card__publish {
  margin: 0;
}

.card__summary {
  margin: 0 0 20px;
  font-size: 14px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.4;
  color: #333;
}

.card__cta {
  margin-bottom: 20px;
  display: inline-block;
  grid-area: card__cta;
  justify-self: start;
  text-decoration: none;
  border-bottom: 4px solid blue;
  
  &:hover {
    color: #4d4dff;
    border-color: #4d4dff;
  }
}

            
          
!
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