<ul class="cards">
    <li class="card">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/js_ebooks.png" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/js1.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/js2.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/js3.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/js4.jpg" alt="">
    </li>
    <li class="card">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/wp_ebooks.png" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/wp1.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/wp2.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/wp3.jpg" alt="">
    </li>

    <li class="card">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/css_ebooks.png" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/css1.jpg" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/css2.jpg" alt="">
    </li>
    <li class="card">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/html_ebook.png" alt="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/HTML.jpg" alt="">
    </li>
  </ul>
* {
  padding: 0;
  margin: 0;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

body {
  background: #f2f2f2;
  padding: 50px;
}
.cards {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  position: relative;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.card:hover {
  cursor: pointer;
}

.card img:not(:first-of-type) {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
}

.card img.is-visible {
  opacity: 1;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.