<div class="container">
  <div class="items">
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <div class="item">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
  </div>
</div>
body {
  background-color: #1a1a1a;
  color: #ccc;
}
.container {
  max-width: 1920px;
}
.item {
  padding: 40px;
  margin-bottom: 20px;
  background-color: #1dbadc;
  box-sizing: border-box;
  font-size: 12px;
  color: #4f4f4f;
  p {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
}
@media (min-width:480px) {
  .item {
    width: 49.1936%;
    float: left;
    margin-right: 1.6129%;
    font-size: 15px;
  }
  .item:nth-child(2n) {
    margin-right: 0;
  }
}
@media (min-width:768px) {
  .item {
    width: 23.6%;
    float: left;
    margin-right: 1.8%;
    font-size: 18px;
  }
  .item:nth-child(2n) {
    margin-right: 1.8%;
  }
  .item:nth-child(4n) {
    margin-right: 0;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.