<section>
  <div class="col">
    <img src="http://placehold.it/400">
  </div>

  <div class="col">
    <img src="http://placehold.it/400">
  </div>

  <div class="col">
    <img src="http://placehold.it/400">
  </div>
  
  <div class="col">
    <img src="http://placehold.it/400">
  </div>

  <div class="col">
    <img src="http://placehold.it/400">
  </div>

  <div class="col">
    <img src="http://placehold.it/400">
  </div>
  
  <div class="col">
    <img src="http://placehold.it/400">
  </div>
  
  <div class="col">
    <img src="http://placehold.it/400">
  </div>
</section>
img {
  width: 100%;
  display: block;
}

.col {
  float: left;
  padding: 10px;
  box-sizing: border-box;
  background-color: #ddd;
  width: calc(100% / 4);
}

@media (max-width: 900px) {
  .col {
    width: calc(100% / 3);
  }
}

@media (max-width: 550px) {
  .col {
    width: calc(100% / 2);
  }
}

@media (max-width: 400px) {
  .col {
    width: 100%;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.