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

              
                <div class="wrapper">
  <div class="grid grid--4">
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
    <div class="grid__item">
      <article class="card">
        <a href="#">
          <div class="card__thumb">
            <img src="https://picsum.photos/300/180" alt="">
          </div>
          <div class="card__content">
            <h3 class="card__title">An awesome title</h3>
            <p class="card__desc">Some description</p>
          </div>
        </a>
      </article>
    </div>
  </div>
</div>

<div class="wrapper">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Optio nihil cupiditate corporis! Ad recusandae animi, dolorum, eos, delectus eligendi sapiente saepe doloremque natus voluptatem asperiores aperiam a hic repellat dolores!</p>
</div>
              
            
!

CSS

              
                $brand-color: #1a6ccc;

.wrapper {
  max-width: 1170px;
  margin: 2rem auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.grid--4 {
  display: flex;
  flex-wrap: wrap;
  margin-left: -16px;
  
  .grid__item {
    flex-basis: 100%;
    padding-left: 16px;
    margin-bottom: 1rem;
    
    @media (min-width: 400px) {
      flex-basis: 50%;
    }
    
    @media (min-width: 700px) {
      flex-basis: 33.33%;
    }
    
    @media (min-width: 1000px) {
      flex-basis: 25%;
    }
  }
}

.card {
  background-color: #eee;
  border-radius: 6px;
  overflow: hidden;
  
  a {
    color: #222;
  }
}

.card__thumb {
  img {
    display: block;
    width: 100%;
  }
}

.card__content {
  padding: 1rem;
}

.card__title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

a {
  text-decoration: none;
}

body {
  font-family: 'Open Sans';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *:before, *:after {
  box-sizing: border-box;
}
              
            
!

JS

              
                
              
            
!
999px

Console