Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <section class="container">
  <div class="main1">
    <h1>Vel Eligendi Provident Suscipit!</h1>
    <section class="cards">
      <div class="card1">
        <h2>Autem Voluptatem Perferendis</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum ipsa tempore doloremque magni illum explicabo voluptatibus quia odit autem.</p>
        <button>LEARN MORE</button>
      </div>
      <div class="card card2">
        <div class="card-info">
          <span class="name">Chicken</span>
          <span class="price">$6</span>
        </div>
      </div>
      <div class="card card3">
        <div class="card-info">
          <span class="name">Beef</span>
          <span class="price">$8</span>
        </div>
      </div>
      <div class="card card4">
        <div class="card-info">
          <span class="name">Fish</span>
          <span class="price">$9</span>
        </div>
      </div>
      <div class="card card5">
        <div class="card-info">
          <span class="name">Sushi</span>
          <span class="price">$12</span>
        </div>
      </div>
    </section>
  </div>
  <div class="main2">
    <article class="article1">
      <h3>Nostrum Velit Praesentium</h3>
      <p>Laudantium dolorem, commodi perferendis officiis quia earum cum obcaecati recusandae, reprehenderit! In earum provident eveniet vero dolorum, voluptatum inventore repellendus molestias laboriosam.</p>
      <button>Learn More</button>
    </article>
    <div class="article-image"></div>
  </div>
</section>
              
            
!

CSS

              
                * { box-sizing: border-box; }

body {
  background-color: #272f32;
  color: #555;
  font-family: Helvetica, sans-serif;
  margin: 0;
  padding: 0;
}

h1,h2,h3 { font-family: Garamond, serif; }
h1 { font-size: 30px; padding-top: 20px; margin-bottom: 0; }

button {
  background-color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  color: #9dbdc6;
  font-weight: bold;
}

.container {
  background-color: #eee;
  text-align: center;
  width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
}

.main2 {
  background-color: #f9f9f9;
  padding: 40px;
}

.main2 button {
  background-color: #9dbdc6;
  color: #fff;
}

.main2 .article-image {
  background: url('http://lorempixel.com/400/400/food/5') top center no-repeat;
  border-radius: 4px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(2, 200px);
  grid-gap: 20px;
  padding: 40px;
}

.card {
  background-color: white;
  border-radius: 4px;
  position: relative;
}

.card1 {
  grid-column-end: span 2;
  padding: 10px;
  background-color: #9dbdc6;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
}

.card1 h2 {
  margin-top: 10px;
  font-size: 24px;
  font-weight: normal;
}

.card2 {
  background: url('http://lorempixel.com/400/200/food/1') top center no-repeat;
}

.card3 {
  background: url('http://lorempixel.com/400/200/food/2') top center no-repeat;
}

.card4 {
  background: url('http://lorempixel.com/400/200/food/3') top center no-repeat;
}

.card5 {
  background: url('http://lorempixel.com/400/200/food/4') top center no-repeat;
}

.card-info {
  background-color: #fff;
  padding: 10px;
  width: 100%;
  position: absolute;
  bottom: 0;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card-info .name {
  justify-self: start;
  align-self: center;
}

.card-info .price {
  color: #ff3d2e;
  font-weight: bold;
  font-size: 24px;
  justify-self: end;
  align-self: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console