Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="center">
  <h1 class="label"> Blog Cards </h1>
  <div class="card-wrapper">
    <div class="blog-card">
      <div class="blog-card__thumbnail">
        <img src="http://placeimg.com/180/100/nature">
      </div>

      <div class="blog-card__details">
        <div class="blog-card__title">
          Mopar launches modern V-8 crate engine kits for classic muscle cars
        </div>

        <div class="blog-card__description">
          Flat Chrysler Automobiles is making Mopar Crate Hemi Engine             kits available as a factory-backed option for Mopar vehicles             from 1975 and earlier.
        </div>

        <button class="blog-card__action"> 
          <span style="margin-right: 10px"> Read More </span>
          <i class="fa fa-angle-right"> </i>
        </button>
      </div>
    </div>
    
    <div class="blog-card">
      <div class="blog-card__thumbnail">
        <img src="http://placeimg.com/180/100/any">
      </div>

      <div class="blog-card__details">
        <div class="blog-card__title">
          Mopar launches modern V-8 crate engine kits for classic muscle cars
        </div>

        <div class="blog-card__description">
          Flat Chrysler Automobiles is making Mopar Crate Hemi Engine             kits available as a factory-backed option for Mopar vehicles             from 1975 and earlier.
        </div>

        <button class="blog-card__action"> 
          <span style="margin-right: 10px"> Read More </span>
          <i class="fa fa-angle-right"> </i>
        </button>
      </div>
    </div>
    
    <div class="blog-card">
      <div class="blog-card__thumbnail">
        <img src="http://placeimg.com/180/100/people">
      </div>

      <div class="blog-card__details">
        <div class="blog-card__title">
          Mopar launches modern V-8 crate engine kits for classic muscle cars
        </div>

        <div class="blog-card__description">
          Flat Chrysler Automobiles is making Mopar Crate Hemi Engine             kits available as a factory-backed option for Mopar vehicles             from 1975 and earlier.
        </div>

        <button class="blog-card__action"> 
          <span style="margin-right: 10px"> Read More </span>
          <i class="fa fa-angle-right"> </i>
        </button>
      </div>
    </div>
  </div>
</div>

<div class="center">
  <h1 class="label"> Product Cards </h1>
  <div class="card-wrapper">
    <div class="product-card">
      <div class="product-card__thumbnail">
        <img src="http://placeimg.com/220/150/people">
      </div>
      
      <div class="product-card__details">
        <div class="product-card__title">
          3 Cans Liquid Moly Undercoat
        </div>
        
        <div class="product-card__description">
          Lorem ipsum keme keme keme 48 years sa na ang na shonget wasok           chaka ganders bakit cheapangga ang at Gino at nang bonggakea
        </div>
        
        <button class="product-card__action">
          Buy Now
        </button>
      </div>
    </div>
    
    <div class="product-card">
      <div class="product-card__thumbnail">
        <img src="http://placeimg.com/220/150/nature">
      </div>
      
      <div class="product-card__details">
        <div class="product-card__title">
          3 Cans Liquid Moly Undercoat
        </div>
        
        <div class="product-card__description">
          Lorem ipsum keme keme keme 48 years sa na ang na shonget wasok           chaka ganders bakit cheapangga ang at Gino at nang bonggakea             shonget nang ano sa ano ng katagalugan jutay ng at bakit ang
        </div>
        
        <button class="product-card__action">
          Buy Now
        </button>
      </div>
    </div>
    
    <div class="product-card">
      <div class="product-card__thumbnail">
        <img src="http://placeimg.com/220/150/architecture">
      </div>
      
      <div class="product-card__details">
        <div class="product-card__title">
          3 Cans Liquid Moly Undercoat
        </div>
        
        <div class="product-card__description">
          Lorem ipsum keme keme keme 48 years sa na ang na shonget wasok           chaka ganders bakit cheapangga ang at Gino at nang bonggakea             shonget nang ano sa ano ng katagalugan jutay ng at bakit ang boyband urky jowabella jowabelles quality control klapeypey-klapeypey
        </div>
        
        <button class="product-card__action">
          Buy Now
        </button>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                $color-blue: #727fff;
$color-black: #000;
$color-gray: #888888;
$color-white: #fff;
$mobile: 320px;
$desktop: 1024px;

.center {
  width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.label {
  font-family: 'Quantico';
  text-align: center;
}

.card-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  
  @media screen and (max-width: $mobile) {
    flex-direction: column;
  }
}

.blog-card {
  height: 350px;
  width: 180px;
  margin-left: 15px;
  margin-right: 15px;
    
  .blog-card__thumbnail {
    width: 180px;
    height: 100px;
    object-fit: cover;
  }
  
  .blog-card__details {
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: $color-white;
    box-shadow: 0 1px 7px rgba(0,0,0,0.5);
  }
  
  .blog-card__title {
    font-family: 'Quantico';
    font-size: 8px;
    text-transform: uppercase;
    color: $color-black;
  }
  
  .blog-card__description {
    font-family: 'Open Sans';
    font-weight: 300;
    font-size: 8px;
    color: $color-gray;
  }
  
  .blog-card__action {
    background: transparent;
    border: none;
    font-family: 'Quantico';
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    color: $color-gray;
    cursor: pointer;
  }
}

.product-card {
  width: 220px;
  margin-left: 15px;
  margin-right: 15px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.5);
  
  .product-card__thumbnail {
    width: 220px;
    height: 150px;
    object-fit: cover;
  }
  
  .product-card__details {
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: $color-white;
  }
  
  .product-card__title {
    font-family: 'Quantico';
    font-size: 12px;
    text-transform: uppercase;
    color: $color-black;
  }
  
  .product-card__description {
    font-family: 'Open Sans';
    font-weight: 300;
    font-size: 11px;
    color: $color-gray;
  }
  
  .product-card__action {
    width: 100%;
    padding: 5px;
    background: $color-blue;
    border: 1px solid $color-blue;
    border-radius: 2px;
    font-family: 'Quantico';
    font-weight: 700;
    text-transform: uppercase;
    color: $color-white;
    cursor: pointer;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console